XL97: Invalid Page Fault After Closing Last Open WorkbookID: Q158895
|
In Microsoft Excel 97, when you close the last open workbook, you may
receive an error message.
If you are using Microsoft Windows 95 or 98, you may see the following
error message:
If you click Details, you receive an error message similar to the followingThis program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
where <xxxx:yyyyyyyy> is any of the following addresses:EXCEL caused an invalid page fault in module EXCEL.EXE at
<xxxx:yyyyyyyy>.
014f:300f1b0a 0137:3003cf1cor any other address starting with "014f:30" or "0137:".
014f:300ef16b
014f:302946ee
014f:3003cf1c
An application error has occurred and an application error log is
being generated.
Excel.exe
Exception: access violation (0xc0000005), Address 0x30296879
This problem may occur when the following conditions are all true:
To correct this problem, obtain Microsoft Excel 97 Service Release 2
(SR-2).
For additional information about SR-2, please see the following article
in the Microsoft Knowledge Base:
Q151261 OFF97: How to Obtain and Install MS Office 97 SR-2
http://www.microsoft.com/support/supportnet/refguide/To work around this problem temporarily, make the Microsoft Excel 97 application object visible BEFORE you create a new workbook, or open an existing workbook or other file. For example, instead of using the following code
xlObj.Workbooks.Open "C:\My Documents\Test.xls"
xlObj.Visible = True
use this code:
xlObj.Visible = True
xlObj.Workbooks.Open "C:\My Documents\Test.xls"
When you switch the order of these two actions, the instance of Microsoft
Excel 97 that you create does not stop responding when you close the last
open workbook.
xlObj.Workbooks.Open "C:\My Documents\Test.xls"
xlObj.Visible = True
xlObj.UserControl = True
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Office 97 Service Release 2 (SR-2).
In Visual Basic, you can use the CreateObject method to create new instances of applications. To create a new instance of Microsoft Excel 97, you use the following code:
Set <objectname> = CreateObject("Excel.Application")
where <objectname> is a variable that you declare as type Object.
The following Visual Basic macro demonstrates the sequence of actions that cause the problem:Sub CreateMSXLObject() Dim xlObj As Object Set xlObj = CreateObject("Excel.Application") 'Action 1 xlObj.Workbooks.Open "C:\My Documents\Test.xls" 'Action 2 xlObj.Visible = True 'Action 3 Set xlObj = Nothing 'Action 4 End Sub
Additional query words: XL97 OLE Automation ipf gpf crash hang
Keywords : kberrmsg kbdta kbdtacode KbVBA xlvbmigrate offinterop
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: July 6, 1999