Check for open workbooks
oxlApp.workbooks.count
or
cnt = 0
for each wkbk in oxlApp.workbooks
if wkbk.windows(1).Visible then
cnt = cnt + 1
end if
Next
--
Regards,
Tom Ogilvy
"Steve Price" wrote in message
...
Hi,
I'm building a database and part of it launches an excel workbook.
Before closing my workbook I'd like to check if there are any other
workbooks open (that the user may be using). If there are no workbooks
open
I'd like to completely close Excel, otherwise just close my workbook.
The snag is, I won't know the file names of the other workbooks.
Is there any way you can check for open workbooks without knowing there
name?
Thanks
|