Auto Execute Macros when opening and closing a file

  • Thread starter Thread starter Amit
  • Start date Start date
A

Amit

Can I write a macro that auto executes if I open the file.

Can I write a macro that executes when I close the file.

Can I hide all the menus and toolbars when I run this
program.
 
Hi Amit

Use a Workbook_Open event handling routine

Use a Workbook_BeforeClose event handling routine

You might look at the following for details on event handlers:

Chip Pearson:
http://www.cpearson.com/excel/events.htm


There's no reason why you can't hide menus and toolbars. The most
important thing though will be to restore them when the workbook is
closed and even then you risk problems when you get a crash out from
Excel.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Thanks. That was great help
-----Original Message-----
Hi Amit

Use a Workbook_Open event handling routine

Use a Workbook_BeforeClose event handling routine

You might look at the following for details on event handlers:

Chip Pearson:
http://www.cpearson.com/excel/events.htm


There's no reason why you can't hide menus and toolbars. The most
important thing though will be to restore them when the workbook is
closed and even then you risk problems when you get a crash out from
Excel.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top