johnske
11-26-2004, 10:03 PM
Hi all,
This should be really basic, but...my memory's failing me
I have code to open and activate a workbook. The inherent assumption is that the book is closed and it works fine when it is closed, but of course it will error out if the book is already open so there should be an If..Then..Else command there. But how do test if the book is open? (I'm sure I've seen/done this somewhere before...)
If '<<the workbook is open>> Then
Workbooks(ArchersName).Activate
Else
Application.Workbooks.Open("C:\Windows\Desktop\" & _
"NewKeeper\DBs\" & ArchersName & ".xls") _
.Activate
End If
This should be really basic, but...my memory's failing me
I have code to open and activate a workbook. The inherent assumption is that the book is closed and it works fine when it is closed, but of course it will error out if the book is already open so there should be an If..Then..Else command there. But how do test if the book is open? (I'm sure I've seen/done this somewhere before...)
If '<<the workbook is open>> Then
Workbooks(ArchersName).Activate
Else
Application.Workbooks.Open("C:\Windows\Desktop\" & _
"NewKeeper\DBs\" & ArchersName & ".xls") _
.Activate
End If