Microsoft KB Archive/310329

= XL2001: Visual Basic Error 35012 When You Open a Workbook That Has Macros =

Article ID: 310329

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Excel 2001 for Mac
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q310329



SYMPTOMS
If you attempt to open an Excel workbook file that contains Microsoft Visual Basic for Applications modules, you may receive the following Visual Basic error message:

Unexpected Error (35012)

The Disable Macros dialog box may also appear, but you may not be able to open the file even if you disable the macros. If you click OK in the error message, Excel closes the workbook but leaves the program open.



CAUSE
This error can occur if the file is damaged, regardless of whether macro code is present in the file.



MORE INFORMATION
There are several methods that you can use to try to recover information from damaged or corrupted files. If you cannot open the damaged file, try one or more of the following methods.  Try to reopen the file in Excel with the Calculation option set to Manual.

To set the Calculation option, follow these steps:  Start Excel to generate a blank workbook. On the Tools menu, click Options. Click the Calculation tab. In the Calculation section, click Manual, and then click OK. On the File menu, click Open, click the damaged file, and then click Open.</li></ol> </li> Try to open the Excel file in Microsoft Word.

If the file opens in Word, you cannot recover module sheets, dialog sheets, chart sheets, macro sheets, or any embedded charts. Also, you cannot recover any cell formulas. You can recover only the results of those formulas that are currently in the cells.

To try to open the file in Word, follow these steps: <ol> Start Word.</li> On the File menu, click Open.</li> In Word 2001, in the Show list, click All Readable Documents, or in Word 98, in the List Files of Type list, click Readable Files.</li> Browse to the Excel file, click the file, and then click Open.</li> You can select an individual worksheet in the Open Worksheet dialog box. This may help diagnose the damage as being in a specific worksheet.</li></ol> </li> Use external references to link to the damaged file.

The most common method of recovering information from a damaged file is to extract the values from the file by using external references to link to the file. The file structure must be complete; otherwise, Excel cannot read the information.For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

147216 XL: Linking to Data in a Damaged File (5.0 and Later)

</li></ul>

Although you cannot avoid file damage of this sort, you can take steps to preserve the integrity of the data by using the option to always create a backup.

To set this option in a file, in the Save As dialog box, click Options, and then click to select the Always create backup check box. You must use this setting for each file that you want to back up. This feature always saves the previous version of an Excel file when you save changes to the file. This helps to protect against file corruption; however, the information in the backup file is one save out of date.

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

142117 XL: Summary of Methods to Recover Data from Corrupted Files

Additional query words: XL2001KB MAC vba XL98 save alert open macro excel XL2001 xl

Keywords: kberrmsg kbinterop kbprb KB310329

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.