What code is executing...

TerryK

New Member
Joined
Jul 28, 2006
Messages
18
If you ask for a new file that uses a template that contains macros and then run the macros and in the macro the code saves ths file is the code still running from the template?

The reason I ask is I'm trying to delete some features of the template after I save it as a normal file. Sheets of tables a command button and drop down list box and the macros. When I was just deleting the macros everything worked like a dream. When I tried to add code to delete the other features Excel started crashing. I've asked and posed the code before but I didn't get an answer but I'd like to understand why even if I can't fix it.

Regards

Terry
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
The short answer is yes.

If you save a workbook through code. The original source of the code is still open. So you must save - close the workbook/template that has the code for the file over-head [things like tracking edits for undo, file names, links, curent addresses, folders and the like] to be done with the files.
 

TerryK

New Member
Joined
Jul 28, 2006
Messages
18
Additional question

If the code is running from the template and the file created from the template has been saved. Why should there be a broblem in deleting bits of the saved file even including the macros that (in the template) used to create the file.

Regards

Terry
 

Forum statistics

Threads
1,136,268
Messages
5,674,734
Members
419,523
Latest member
Urnovio

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
Top