Look at application level events
http://www.cpearson.com/excel/appevent.htm
You would have to use the application level workbook close event to
determine when all the visible workbooks are closed.
You would use the sheetactivate and deactivate events to determine if it is
a worksheet or not.
--
Regards,
Tom Ogilvy
"M. Authement" wrote in message
...
I have added a menu item with several sub-menu commands as part of an
add-in I am developing. Many of these commands deal with modifying or
inserting cell formulas, so I would like to disable those commands if no
workbook is open or if the activesheet is not a worksheet. How do I go
about doing this? I am using WinXP, XL2003.