trying to replace auto_open with something like workbook_open

S

Solutions Manager

I am moving a bunch of macros to a personal.xlsb worksheet so that I can make
existing worksheets macro-free. In these worksheets, Each of these
worksheets, has the same Auto_Open macro that runs through a series of steps.
I need this same macro to run whenever a user opens any excel file.

I don't need help testing the file being opened, I just need to know how to
trigger the macro stored in personal.xlsb each time a user opens any excel
file.

How can I make this macro run each time a user opens a workbook? This macro
is saved in my personal.xlsb file and I cannot seem to find a way to make the
macro run each time I open a workbook.
 
B

Bob Phillips

Public WithEvents App As Application

Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
'your code
End Sub

Private Sub Workbook_Open()
Set App = Application
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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

Top