cosmogramma
IS-IT--Management
I posted a few days ago about an Excel template I've created. The template creates several new excel spreadsheets with data for different users, and I wish to transfer a button and a print formatting macro to these sheets.
In my code I have the following two statements to import the Module with the macro, and assign to the button.
newWbk.VBProject.VBComponents.Import ("W:\XXXX\Module1.bas")
newSht.Shapes("Button 1").OnAction = "PrintFormatted"
For some reason when the new spreadsheet is opened, it's still referencing the original template sheet. I can manually reassign the button the the imported macro and it works fine. Is there a way to automate this as I'm creating the new excel files though?
In my code I have the following two statements to import the Module with the macro, and assign to the button.
newWbk.VBProject.VBComponents.Import ("W:\XXXX\Module1.bas")
newSht.Shapes("Button 1").OnAction = "PrintFormatted"
For some reason when the new spreadsheet is opened, it's still referencing the original template sheet. I can manually reassign the button the the imported macro and it works fine. Is there a way to automate this as I'm creating the new excel files though?