The information in this article applies to:
SYMPTOMSIn Microsoft Excel version 5.0, if you create a Visual Basic, Applications Edition, procedure using the Declare statement to make a Windows API call, you may receive the following error message: If you choose the OK button in the error dialog box, the Declare statement will be highlighted in your macro. CAUSEThe "Invalid inside procedure" message does not necessarily mean that the Declare statement itself is incorrect; it means that the Declare statement is not allowed within a procedure. The Declare, Def, Private, Public, Option Base, Option Compare, Option Explicit, Option Private, and Type statements are only allowed outside the procedure. WORKAROUNDTo work around this problem, move the Declare statement outside of the procedure(that is, include it above the Sub statement in the declarations section of the module). REFERENCESFor more information on the Declare statement, choose Contents from the Help menu, and choose Programming with Visual Basic. Choose the Search button in Help and type: Declare Additional query words:
Keywords : |
Last Reviewed: September 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |