XL2001: Visual Basic Error 35012 When You Open a Workbook That Has Macros (310329)



The information in this article applies to:

  • Microsoft Excel 2001 for Mac
  • Microsoft Excel 98 Macintosh Edition

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:
    1. Start Excel to generate a blank workbook.
    2. On the Tools menu, click Options.
    3. Click the Calculation tab.
    4. In the Calculation section, click Manual, and then click OK.
    5. On the File menu, click Open, click the damaged file, and then click Open.
  • 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:
    1. Start Word.
    2. On the File menu, click Open.
    3. 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.
    4. Browse to the Excel file, click the file, and then click Open.
    5. You can select an individual worksheet in the Open Worksheet dialog box. This may help diagnose the damage as being in a specific worksheet.
  • 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)

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


Modification Type:MajorLast Reviewed:9/11/2002
Keywords:kberrmsg kbinterop kbprb KB310329