This function from John Walkenback should do it;
Private Function WorkbookIsOpen(wbname) As Boolean
' Returns TRUE if the workbook is open
Dim x As Workbook
On Error Resume Next
Set x = Workbooks(wbname)
If Err = 0 Then WorkbookIsOpen = True _
Else WorkbookIsOpen = False
End Function
http://www.j-walk.com/ss
Have a look @ his site for some GREAT stuff.
Ivan
Thank you for your response. I have been
experimenting with the code you recommended and it
doesn't toggle from False to True when the
WorkbookIsOpen function is programmed into a cell.
My aplication requires the used of manual
recalculate. It will however toggle when the cell
is selected and the Insert>Function box is used.
What am I doing wrong?
Ken Brading
Thank you for your response. I have been
experimenting with the code you recommended and it
doesn't toggle from False to True when the
WorkbookIsOpen function reference is programmed
into a cell. My aplication requires the used of
manual recalculate. It will however toggle when
the cell is selected and the Insert>Function box
is used. What am I doing wrong?
Ken Brading
Ken try;Function WkbkIsOpen(wbname) As Boolean
' Returns TRUE if the workbook is open
Application.Volatile
Dim x As Workbook
On Error Resume Next
Set x = Workbooks(wbname)
If Err.Number = 0 Then WkbkIsOpen = True _
Else WkbkIsOpen = False
End Function
Ivan
Ivan,
Thank you for your assistance.
The code you recommended worked great!!
Ken Ivan