XL97: Error Opening Workbook That Is Modified By Using DAO (172356)
The information in this article applies to:
- Microsoft Excel 97 for Windows
This article was previously published under Q172356 SYMPTOMS
In Microsoft Excel 97, when you open a workbook, you may receive the
following error message:
This program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
If you click Details, you receive an error message similar to either of the
following:
EXCEL caused an invalid page fault in module EXCEL.EXE at
0137:3019b403.
EXCEL caused an invalid page fault in module KERNEL32.DLL at
0137:bff9a5d0.
CAUSE
This problem may occur if the following conditions are true:
WORKAROUND
If this problem occurs, you cannot open the workbook. You may be able to
recover data contained within the workbook if you follow the steps shown in
the following articles in the Microsoft Knowledge Base:
142117 Excel: Summary of Methods to Recover Data from Corrupted Files
147216 XL: Linking to Data in a Damaged File (5.0 and Later)
To prevent this problem, do not use Data Access Objects to add or modify
records in a Microsoft Excel 97 workbook if the workbook contains formulas
that refer to functions in the Analysis ToolPak.
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article. This problem no longer occurs in
Microsoft Excel 2000.
MORE INFORMATIONMicrosoft provides programming examples 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 article assumes
that you are familiar with the programming language being demonstrated and the
tools used to create and debug procedures. Microsoft support professionals can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct procedures to
meet your specific needs. If you have limited programming experience, you may
want to contact a Microsoft Certified Partner or the Microsoft fee-based
consulting line at (800) 936-5200. For more information about Microsoft Certified
Partners, please visit the following Microsoft Web site:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
In Microsoft Excel 97, you can use Data Access Objects in a Visual Basic
for Applications macro to add, remove, or modify records in a database. If
the database is in a Microsoft Excel 97 workbook, you can add a record to
the list in the workbook by using a macro similar to the following sample
code:
Sub AddRecordToTest()
' IMPORTANT: Create a reference to "Microsoft DAO 3.5 Object
' Library" before you attempt to run this macro. To reference the
' library, click References on the Tools menu, click the check box
' for the library and click OK.
' Dimension variables for use by DAO.
Dim Db As Database
Dim Rs As Recordset
' Open the database in Test.xls.
Set Db = OpenDatabase("C:\My Documents\Test.xls", _
False, False, "Excel 8.0;")
' Open the list in Sheet1 of Test.xls. The list starts in cell A1.
' These commands select the last record in the list, add a new
' record, set the value in the first column of the list, and update
' the list.
Rs.MoveLast
Rs.AddNew
Rs.Fields(0).Value = 1
Rs.Update
' Close the list and database.
Rs.Close
Db.Close
End Sub
If you run this macro, a new record containing the value 1 is added to the
list in Sheet1 of Test.xls. However, if Test.xls contains a formula that
refers to a function included in the Analysis ToolPak, you cannot open
Test.xls after running this macro.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kbcode kberrmsg kbProgramming KB172356 |
---|
|