Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call user define function when excel sheet being opened

Tags:

excel

vba

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

like image 894
Nimo Avatar asked Mar 21 '26 16:03

Nimo


1 Answers

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.

like image 141
Jens Avatar answered Mar 24 '26 11:03

Jens



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!