How can I pass user-defined variables to xlam files?
I have written a macro and saved on an xlam file. I reference the xlam in an xlsm file and I call the macro from the xlsm. I want to pass a user-defined variable to the macro, the user-defined type being defined in the xlsm file as public. I get a "compile error: User=defined type not defined" in the xlam file.
Thanks in advance
[edit] After several trial and error I believe I have solved the problem.
Some (shortened )code below for others to use. Hope this helps.
In the library file I declare the UDT (user defined type) and I write the macro.
Public Type chartType chartObject As Variant ... End Type Public Sub formatting_chart(cht As chartType) [code here] End Sub In the xlsm file I declare the variable and call the library macro as follows:
Public cht As chartType Call lib01.formatting_chart(cht)