Sample Macro to Open or Activate a Workbook (135390)
The information in this article applies to:
- Microsoft Excel 97 for Windows
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0
This article was previously published under Q135390 SUMMARY
When you activate a workbook with a Visual Basic for Applications
procedure, the workbook must first be open. If the workbook is closed, you
will receive one of the following error messages:
Run-time error '1004':
Workbook method of Application class failed
Run-time error '9':
Subscript out of range
The Visual Basic procedure in the "More Information" section of this
article will activate Book2.xls if it is already open, or it will open and
activate Book2.xls if it is closed.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbdtacode kberrmsg kbhowto kbProgramming KB135390 |
---|
|