Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL: Code Module May Be Missing After Opening and Saving Workbook as Web Page


View products that this article applies to.

This article was previously published under Q221493

↑ Back to the top


Symptoms

If you save a file as a Web page, and that file contains Visual Basic for Applications macro code, when you reopen the file, you receive no warning that the file contains macros. If you go into the Visual Basic Editor there are no code modules and no Sub procedures available for that workbook.

↑ Back to the top


Cause

This problem occurs when all of the following conditions are true:
  • You open a workbook containing macro code, that you saved as a Web page (HTML file).

    -and-

  • Excel cannot read the Editdata.mso file associated with the page. This problem occurs when any of the following conditions are true:

    • Another process locks the Editdata.mso file associated with the file.

      -or-

    • The file does not have Write permissions (if saved on an NTFS partition).

      -or-

    • The file is deleted.

When you save an entire workbook as a Web page (HTML), Excel stores all Visual Basic for Applications and OLE information in a file called Editdata.mso. It saves this file in a folder called filename_files in the same directory as the HTML file.

If Excel cannot read the Editdata.mso file when loading the HTML file, it doesn't display any warning, nor does it write it out again during any subsequent save. During the save operation, Excel detects that the Editdata.mso was not saved, and so it deletes any existing Editdata.mso file as unneeded. With no Editdata.mso file, therefore, the HTML file loses any macros.

↑ Back to the top


Keywords: KB221493, kbprb, kbpending

↑ Back to the top

Article Info
Article ID : 221493
Revision : 4
Created on : 1/24/2007
Published on : 1/24/2007
Exists online : False
Views : 318