Hi,
I have an Excel 2013 workbook template that the user opens, and then must click on a shape to run a macro that assigns a unique name to the template copy file using a region code and the date, and also sets the date in cell ("N3:O3"). Apparently clicking the shape is sometimes overlooked, so I've been testing how to automatically run the macro when the template is opened using the AutoOpen feature. Initially, it works fine. The problem is that the macro stays with the newly named macro-enabled workbook and tries to run whenever it is opened. Maybe there is a way to restrict the macro to the original template or maybe it could be corrected by bypassing the code in the macro based on one of a couple of conditions. As of yet, I don't know how to write that code. The conditions could be:
- if the file being opened is not the original template (*.xltm), then skip the code, or
- if the date cell is not the default date, which apparently is 00-Jan-00, then skip the code
Any ideas are greatly appreciated. I'm sure it must be a simple if/then thing, but programming doesn't like unspecific language!
Thanks in advance for the help.
Bookmarks