I wrote the following code to allow users to open a variety of
attached documents in a training app. All types work except the
powerpoint documents. Can anyone see a problem. I get an error saying
"presentations(unknown member):invalid request. The powerpoint frame
window does not exist" It is not a problem with the document or its
path as I have opened Word and Excel documents in the same path.
On Error GoTo PROC_ERR
Dim varPath
Dim objOApp As Object
varPath = Me!Path 'the document path in the attacheddocs_tbl
Select Case Right(varPath, 3)
Case "doc"
Set objOApp = CreateObject("Word.Application"
objOApp.WindowState = wdWindowStateMaximize
objOApp.Documents.Open FileName:=(varPath), ReadOnly:=False
objOApp.Visible = True
Case "xls"
Dim objExcel As Excel.Application
Set objExcel = CreateObject("excel.Application"
With objExcel
.WindowState = xlMaximized
.Workbooks.Open FileName:=(varPath), ReadOnly:=False
.Visible = True
End With
Case "ppt"
Dim objPP As PowerPoint.Application
Set objPP = CreateObject("powerpoint.Application"
With objPP
.Presentations.Open FileName:=(varPath), ReadOnly:=False
.WindowState = ppWindowMaximized
.Visible = True
End With
End Select
Exit Sub
PROC_ERR:
MsgBox "The following error occured: " & Error$
Resume Next
attached documents in a training app. All types work except the
powerpoint documents. Can anyone see a problem. I get an error saying
"presentations(unknown member):invalid request. The powerpoint frame
window does not exist" It is not a problem with the document or its
path as I have opened Word and Excel documents in the same path.
On Error GoTo PROC_ERR
Dim varPath
Dim objOApp As Object
varPath = Me!Path 'the document path in the attacheddocs_tbl
Select Case Right(varPath, 3)
Case "doc"
Set objOApp = CreateObject("Word.Application"
objOApp.WindowState = wdWindowStateMaximize
objOApp.Documents.Open FileName:=(varPath), ReadOnly:=False
objOApp.Visible = True
Case "xls"
Dim objExcel As Excel.Application
Set objExcel = CreateObject("excel.Application"
With objExcel
.WindowState = xlMaximized
.Workbooks.Open FileName:=(varPath), ReadOnly:=False
.Visible = True
End With
Case "ppt"
Dim objPP As PowerPoint.Application
Set objPP = CreateObject("powerpoint.Application"
With objPP
.Presentations.Open FileName:=(varPath), ReadOnly:=False
.WindowState = ppWindowMaximized
.Visible = True
End With
End Select
Exit Sub
PROC_ERR:
MsgBox "The following error occured: " & Error$
Resume Next