PDA

View Full Version : A macro code to check whether any workbook is currently open or not.



abhay_547
04-11-2010, 04:25 AM
Hi All,

I have created some toolbars for essbase connection. I won't a macro which will check whether there is any workbook which currently open or not. If there is no workbook open then macro should have code line which will show a message to the user that there is no workbook currently open and he can't run a macro. I have got a macro which check whether a particular workbook is open or not but it becomes specific because i will have to mention the name of the workbook. I want a macro code which will check whether any workbook is open or not. Please expedite. Thanks a lot for your help in advance.

Paul_Hossler
04-11-2010, 05:54 AM
I use something like

If ActiveWorkbook is Nothing then
MSgbox
Endif

Paul

abhay_547
04-11-2010, 06:22 AM
Hi,

Thanks a lot. It's working now.