Auto Execute Macros when opening and closing a file

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.
 
N

Norman Harker

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
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
A

amit

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
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.



.
 
Top