Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Workbook if not already opened
I am looking for a procedure that opens a workbook if it is not already open.
How do I find out if a workbook is currently open? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open Workbook if not already opened
The following code should work
Sub isOpen() On Error GoTo notOpen Set xlTest = Workbooks("Workbook.xls") MsgBox "Workbook is open" Exit Sub notOpen: MsgBox "The workbook is NOT open" Workbooks.Open ("c:\Workbook.xls") End Sub Replace the Workbook.xls name with the actual name of your workbook. You'll also need to specify the path in the Workbooks.Open method in the second to last line. -- http://HelpExcel.com 1-888-INGENIO 1-888-464-3646 x0197758 "gottahavit" wrote: I am looking for a procedure that opens a workbook if it is not already open. How do I find out if a workbook is currently open? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
open workbook b when workbook a opened | Excel Discussion (Misc queries) | |||
Form to open when workbook is opened | Excel Worksheet Functions | |||
When I open a workbook, another one called Book1 is also opened. W | Excel Discussion (Misc queries) | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming | |||
Opening a workbook if not opened, going to it if already opened | Excel Programming |