PPT7: OLE Automation Error Using Open MethodLast reviewed: March 6, 1998Article ID: Q155073 |
The information in this article applies to:Microsoft PowerPoint for Windows 95, version 7.0
SYMPTOMSIf you try to use a Microsoft Excel or Word macro, or another Visual Basic for Applications procedure to open a PowerPoint 95 presentation, you may receive the following error message:
Runtime Error: '-2147188160 (80048240)': Presentation.Open invalid request. The PowerPoint Frame Window does not exist. CAUSEThis error will occur if you use the Application.Presentations.Open method before showing the PowerPoint application window at least once. A simple example of code that will produce this error follows:
Private Sub Form_Load() Dim ppt As Object Dim pres As Object Set ppt = CreateObject("PowerPoint.application.7") Set pres = ppt.presentations.open("c:\windows\desktop\test.ppt") End SubThe error will occur at the "Set Pres..." line.
RESOLUTIONMicrosoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose. To work around this problem, use the following steps to modify the macro:
ppt.AppWindow.Windowstate = ppWindowMinimizedThis line must come after the "ppt.AppWindow.Visible" command, otherwise the window will not be minimized. The code might look something like the following:
Private Sub Form_Load() Dim ppt As Object Dim pres As Object Set ppt = CreateObject("PowerPoint.application.7") ppt.AppWindow.Visible = True ppt.AppWindow.Windowstate = ppWindowMinimized Set pres = ppt.presentations.open("c:\windows\desktop\test.ppt") End Sub STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
|
Additional query words: VBA Access Excel PowerPoint VB powernt
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |