tags:

views:

31

answers:

2

Hi,

I'm trying to call a function when a workbook is being opened. I used workbook_open() event. But I notice that before calling function which is inside workbook_open(), all the functions that already exists in the workbook are being called.

How can I call my function to execute before calling any of functions in the workbook?

Thank you

+1  A: 

I do not believe that there is a event for this in VBA.

You could add a check to all your other functions, cancelling them if Workbook_Open has not occured yet.

Jens
A: 

If the functions that you don't want to run are used on the sheets themselves, then you could turn off automatic calculation during the workbook_beforeclose event. Then when you open the workbook you can call the function in the workbook_open event then turn on automatic calculations.

guitarthrower