import sheets and macro from template file (Excel 2007)

novel

New Member
Joined
Jan 16, 2012
Messages
39
The macro I currently have runs from an open workbook and imports sheets from another workbook that is closed. This workbook has "templated" tabs which is why they are being imported.

It was proposed in order to have updates to the macro be more flexible (i.e., users would not have to download and upload the .bas file), the macro should be in a .xltm file. Reading the benefits and purpose of the .xltm file, I was wondering if it was possible to add the sheets and the macro from a .xltm file to a workbook that is already opened, but not saved.

Why I changed the Type on the Sheets.Add method to the path of the .xltm file, it added the sheets but not the module in the sheet.

The ultimate goal is to have a a new workbook with data import templated sheets then run some macros all in one process (i.e., once the .xltm macro is in the new workbook, the new macor can be called and run without stopping and having to call it manually in the View Macro dialog box).

If this not possible, then that will save me some time. If there are other methods to accomplish what I'm wanting to occur, I'm open to ideas.

Thanks in advance.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,215,692
Messages
6,126,226
Members
449,303
Latest member
grantrob

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top