Microsoft KB Archive/302616

= XL2001: Error Messages Appear When You Open an Excel Workbook That Has a Visual Basic Macro =

Article ID: 302616

Article Last Modified on 1/31/2007

-

APPLIES TO


 * Microsoft Excel 2001 for Mac

-



This article was previously published under Q302616



SYMPTOMS
If you open a workbook that contains a Microsoft Visual Basic for Applications macro, you may receive an error message similar to one of following error messages:

Error in loading dll

Object Lib not registered

Out of Memory

The application &quot;Microsoft Excel&quot; has unexpectedly quit, because an error of type 2 occurred.



CAUSE
This behavior can occur under either of the following conditions:
 * The Excel file is too large for Excel to load completely in available memory, and therefore some of the files that Visual Basic needs are not loaded.
 * Files that Visual Basic needs are missing or damaged.



RESOLUTION
To resolve this behavior, first find out whether the behavior is caused by lack of memory or by missing or damaged Visual Basic files, and then take corrective measures.

Lack of Memory
To see whether Visual Basic can work under minimal or existing memory availability, follow these steps:
 * 1) Start Excel, and then create a new workbook.
 * 2) On the Tools menu, point to Macro, and then click Record New Macro.
 * 3) Under Store macro in, click This Workbook so that later you can easily delete the macro from this sample file. Accept the default name of Macro1.
 * 4) Click OK.
 * 5) * If you receive a Visual Basic error, skip to the &quot;Missing or Damaged VBA Files&quot; section of this article.
 * 6) * If you do not receive a Visual Basic error, the Visual Basic Stop Recording toolbar appears. Select a block of cells by highlighting B3:D7. This action is recorded in the macro.
 * 7) Click the square Stop Recording button.
 * 8) Select A1, point to Macro on the Tools menu, and then click Macros. When you see a Macro1 item, double-click the Macro1 item, and then note that B3:D7 is selected.

If this procedure is successful, Visual Basic is running correctly and is not causing the behavior. The cause is probably lack of memory.

To resolve this behavior if the cause is lack of memory, increase the preferred memory allocation for Excel in exact multiples of the suggested size. Increasing the memory that is allocated to the program helps prevent lack of memory in the future.

To increase the preferred memory allocation for Excel, follow these steps:  If Excel is open, click Quit on the File menu to quit Excel. Use Finder to locate the Excel program icon, and then click the Excel program icon. On the File menu, point to Get Info, and then click Memory to open the Microsoft Excel Info dialog box. If necessary, click Memory in the Show list. Under Preferred Size, type an exact multiple of the suggested size (that is, multiply the suggested size by an integer).

Note that this memory requirement for Excel is unlike that of other programs on the Macintosh. With Excel, if the suggested size is for example 6,344, you must set the preferred size to 12,688 or to some other (higher) exact multiple of 6,344.

Do not increase or decrease the Minimum Size memory setting. Changing this memory setting can cause problems with the program. Click the Close box in the upper left corner of the dialog box.For additional information about adjusting memory settings for programs on the Macintosh, click the article number below to view the article in the Microsoft Knowledge Base:

141682 How to Change Memory Allocations for Macintosh Programs

 Repeat steps 1 through 5 until you can open the file, or until all available memory is assigned to Excel. You can find out how much memory is available by clicking About This Computer on the Apple menu while Finder is active.</li></ol>

Missing or Damaged VBA Files
If you received an error when you tried to record a simple macro, you need to reinstall Microsoft Office 2001. Follow these steps: <ol> Move any personal files, the Normal Word file if you have modified it, and any templates that you have modified out of the Microsoft Office 2001 folder and subfolders.</li> Remove Office 2001 by using a downloaded utility. For additional information about how to do that, click the article number below to view the article in the Microsoft Knowledge Base:

269856 OFF2001: How to Remove Microsoft Office 2001 from Your Computer

</li> Insert the Office 2001 CD, and then drag the Microsoft Office 2001 folder from the CD to the hard drive, to copy the folder to the hard drive.</li> Start Excel from the folder that you copied to the hard Drive.</li> Test Visual Basic by recording a simple macro in Excel.</li>  If this test does not succeed, drag the following files to the desktop from the Preferences folder in the System folder: <pre class="fixed_text">  File name                       Folder location --  PPC Registration Database       System:Preferences Registration Database          System:Preferences Note that you might not find the Registration Database file if the only programs that are installed on the computer are programs that are designed for the Power PC. </li> Again, test the recording of a macro. If the test is successful, move the two files that you placed on the desktop to the Trash, and then empty the Trash.</li></ol>

Additional query words: XL2001KB mac XL2001 memory VBA error alert xl

Keywords: kbhardware kbprb KB302616

-

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

© Microsoft Corporation. All rights reserved.