C
Colin
Hi, hopefully someone can help.
I have a user that has an excel spreadsheet that they have placed button
controls on that they hope to code to open other applications from existing
templates.
I have been able to open a word and excel fine but am having problems
opening a PowerPoint presentation from a template and an InfoPath from a
template.
-----------------------------------------------------
Code that is working for Word:
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Word.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Word.Application")
End If
appwd.Visible = True
On Error GoTo 0
With appwd
.Documents.Add ("C:\Desktop\Fixes\Excel\template1.dot")
End Wit
-------------------------------------------------------------------------------------
Code that is not working for Powerpoint and Infopath
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Powerpoint.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Powerpoint.Application")
End If
appwd.Visible = True
On Error GoTo 0
With appwd
.Presentations.Add ("C:\Desktop\Fixes\Excel\TEMPLATE.pot")
End With
End Sub
Private Sub CommandButton3_Click()
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Infopath.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Infopath.Application")
End If
'appwd.Visible = True
On Error GoTo 0
With appwd
.XDocuments.Add ("C:\Desktop\Fixes\Excel\Template Request a Resource
OPS.xsn")
-----------------------------------------------
For powerpoint I can open the template direct is I change the
..Presentations.Add to .Presentations.Open, but the user needs to open a
instance not the template?
Thanks for you time,
Colin
I have a user that has an excel spreadsheet that they have placed button
controls on that they hope to code to open other applications from existing
templates.
I have been able to open a word and excel fine but am having problems
opening a PowerPoint presentation from a template and an InfoPath from a
template.
-----------------------------------------------------
Code that is working for Word:
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Word.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Word.Application")
End If
appwd.Visible = True
On Error GoTo 0
With appwd
.Documents.Add ("C:\Desktop\Fixes\Excel\template1.dot")
End Wit
-------------------------------------------------------------------------------------
Code that is not working for Powerpoint and Infopath
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Powerpoint.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Powerpoint.Application")
End If
appwd.Visible = True
On Error GoTo 0
With appwd
.Presentations.Add ("C:\Desktop\Fixes\Excel\TEMPLATE.pot")
End With
End Sub
Private Sub CommandButton3_Click()
Dim appwd As Object
On Error GoTo notloaded
Set appwd = GetObject(, "Infopath.Application")
notloaded:
If Err.Number = 429 Then
Set appwd = CreateObject("Infopath.Application")
End If
'appwd.Visible = True
On Error GoTo 0
With appwd
.XDocuments.Add ("C:\Desktop\Fixes\Excel\Template Request a Resource
OPS.xsn")
-----------------------------------------------
For powerpoint I can open the template direct is I change the
..Presentations.Add to .Presentations.Open, but the user needs to open a
instance not the template?
Thanks for you time,
Colin