2
votes

I'm trying to perform the below operation from a workbook (Say A.xlsm):

  1. Opening another workbook (say B.xlsb)
  2. Calling a macro in B.xlsb from A.xlsm
  3. Save the workbook B.xlsb
  4. Close the workbook 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.

Image showing Initialize macro in B.xlsb

1
Which function in your B.xlsb is calling the Initialise sub? also can you provide the code that actually makes the call to this sub? - Zac
We are using a product named Boardwalk which is made on top of Excel. They have modified Excel by adding a lot of features and also their customized ribbon menu. We have done a lot of customization on this product to match our specific requirements. I asked them the question that from where are they calling Initialize method as I was not able to find, and they replied that they are using XML configuration to call it at the time of loading - Akash Deep Sharma
Without knowing how you are calling the function and I don't know anything about Broadwalk, unfortunately there isn't much more I can offer. Hope you get this resolved - Zac

1 Answers

1
votes

Workbook functions don't have function Initialize. Refer Workbook object