Reputation: 29
I'm trying to perform the below operation from a workbook (Say A.xlsm
):
B.xlsb
)B.xlsb
from A.xlsm
B.xlsb
B.xlsb
Below is the code in A.xlsm
:
Workbooks.Open(Filename:=B.xlsb).RunAutoMacros Which:=xlAutoOpen
Workbooks(B.xlsb).Activate
Windows(B.xlsb).Activate
Application.Run (B.xlsb& "!MyMacro")
Above all works fine, but a macro (Initialize
, which is for initializing the ribbon object) gets skipped in B.xlsm
which is should get called at the time of loading of the workbook B.xlsb
. When I open it manually and then Save and close.
I see the macros Workbook_Open
, Workbook_Activate
and Initialize
(this is configured in an XML to be called at the loading time) gets called in sequence.
But the same when I do from VBA then Workbook_Open
and Workbook_Activate
are called but Initialize
gets skipped.
Upvotes: 2
Views: 165
Reputation: 501
Workbook functions don't have function Initialize
. Refer Workbook object
Upvotes: 1