XL: Err Msg: Error in Procedure Causes "Cannot Find Procedure"ID: Q107469
|
In Microsoft Excel, when you open a workbook that contains a defined-name automatic Visual Basic procedure, you may receive the following error message:
where <procedure> is the name of the Visual Basic procedure that has been defined on a worksheet in <workbook> with a name that begins with Auto_Open and <worksheet> is the first worksheet in <workbook>.Cannot find <procedure>, which has been assigned to run each time [<workbook>]<worksheet> is opened. Continuing could cause errors. Cancel opening [<workbook>]<worksheet>?
You can create a defined name on a worksheet that refers to a Visual Basic
procedure so that it automatically runs that procedure when the worksheet
is opened, closed, activated, or deactivated. If you define a name that
begins with Auto_Open, Auto_Close, Auto_Activate, or Auto_Deactivate, and
the name refers to a Visual Basic procedure, that procedure will run when
the described action is performed on the worksheet.
If the procedure contains an error, such as a syntax error, the error
message described above will occur when the procedure is run as a defined-
name automatic procedure. The error indicates that the procedure was not
found, although the actual cause of the error may be a runtime error in the
procedure itself.
NOTE: If the same macro is run as an automatic procedure (the procedure is
given the name Auto_Open or Auto_Close) and you do not have a defined name
called "Auto_Open", without quotes, the correct error will appear. For more
information about creating automatic procedures and using defined-name
automatic procedures, see pages 266-268 in the "Visual Basic User's Guide,"
version 5.0.
Additional query words:
Keywords : kbprg
Version : WINDOWS:5.0,7.0,97
Platform : WINDOWS
Issue type :
Last Reviewed: July 23, 1999