Excel template with macros - strange behaviour?

%3CLINGO-SUB%20id%3D%22lingo-sub-3114865%22%20slang%3D%22en-US%22%3EExcel%20template%20with%20macros%20-%20strange%20behaviour%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3114865%22%20slang%3D%22en-US%22%3E%3CP%3EWorkflow%3A%3C%2FP%3E%3CP%3EFor%20each%20new%20client%20we%20create%20a%20new%20workbook%20which%20will%20become%20the%20cutlist%20for%20our%20CNC%20machine.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20Excel%20template%20(.xltm)%20that%20contains%20a%20few%20macros.%20The%20macros%20are%20displayed%20to%20the%20user%20in%20a%20custom%20Ribbon%20tab.%20Upon%20use%20of%20a%20macro%20within%20the%20new%20workbook%20(.xlsm)%20created%20from%20the%20template%2C%20the%20template%20itself%20is%20opened%20in%20the%20background.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20can't%20figure%20out%20how%20to%20tell%20Excel%20to%20reassign%20ownership%2Fconnection%2Frelationship%20of%20the%20macros%20to%20the%20newly%20created%20.xlsm.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEg%3A%3C%2FP%3E%3CP%3E1.)%20I%20create%20a%20new%20workbook%20by%20clicking%20the%20template.%20I%20immediately%20save%20it%20as%26nbsp%3B%20'CLIENTNAME.xlsm'.%20The%20only%20workbook%20open%20is%20the%20current%20one%2C%20and%20the%20template%20is%20not%20open.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.)%20After%20entering%20information%20and%20preparing%20the%20cutlist%2C%20I%20then%20use%20a%20macro%20to%20distill%20the%20main%20sheet%20and%20create%20a%20new%20sheet%20for%20use%20with%20pour%20CNC%20machine.%26nbsp%3B%20When%20I%20click%20on%20any%20macro%20shown%20in%20the%20Macro%20tab%20of%20the%20ribbon%20to%20run%20it%2C%20the%20template%20immediately%20opens%20in%20the%20background%20but%20does%20not%20take%20focus.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help%20me%20make%20the%20macros%20part%20of%20the%20new%20file%20and%20not%20make%20the%20template%20open%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3114865%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

 

Excel version 16.0.14827.20158, on Windows 10, using OneDrive for file storage.

 

Workflow:

For each new client we create a new workbook which will become the cutlist for our CNC machine.

 

I have an Excel template (.xltm) that contains a few macros. The macros are displayed to the user in a custom Ribbon tab. Upon use of a macro within the new workbook (.xlsm) created from the template, the template itself is opened in the background.

 

I can't figure out how to tell Excel to reassign ownership/connection/relationship of the macros to the newly created .xlsm.

 

Eg:

1.) I create a new workbook by clicking the template. I immediately save it as  'CLIENTNAME.xlsm'. The only workbook open is the current one, and the template is not open.

 

2.) After entering information and preparing the cutlist, I then use a macro to distill the main sheet and create a new sheet for use with pour CNC machine.  When I click on any macro shown in the Macro tab of the ribbon to run it, the template immediately opens in the background but does not take focus.

 

Please help me make the macros part of the new file and not make the template open?

4 Replies
Hi drew,
thanks for asking your query, i request you to add on the version of excel please!!
could you please tell us too, what steps you took to resolve it? for those who are into same trouble in future .
thanks

@harshulz-

Sorry for the delay. Long weekend here in NZ.

I renamed the macros, to no effect.

Then I started googling - but I get a million google hits, none of which are my problem .

So, I have not done much because I don't even know what governs this behaviour.