Microsoft Knowledge Base |
|
Excel: Can't Open Template with NEW() in Auto-Open Macro |
|
|
Last reviewed: September 12, 1996
Article ID: Q102336 |
|
The information in this article applies to:
SYMPTOMSWhen you use the NEW() function in an auto-open macro that runs at startup, if you use a saved template name (that is, worksheet, sheet) the macro will halt and will not open a template. Also, note that page 285 of the "Function Reference" states that you can use quoted text to open a nondefault template. This information is not correct if you use the NEW() function in an auto-open macro. If you use a text string enclosed in quotation marks for the type_num argument in the NEW() function in an auto-open macro, the macro will halt and will not open a template.
CAUSEThis behavior occurs because the auto-new macro is loaded before the list of template names is loaded in memory, and therefore, the template is unavailable at the time that the NEW() function is run.
WORKAROUNDTo work around this problem, use the OPEN() function instead of the NEW() function to open a worksheet based on the saved template.
MORE INFORMATIONYou can use NEW() with a type_num argument of 1 through 5 to successfully open the standard (default) templates in Microsoft Excel.
Steps to Reproduce SituationTo duplicate the behavior described above:
REFERENCES"Function Reference", version 4.0, page 285
|
|
KBCategory: kbdocerr
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |