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.
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.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks