Running a macro on a template

  • Thread starter Thread starter donny
  • Start date Start date
D

donny

I'm trying to run a macro on a template that is linked to
a database, but everytime i open the spreadsheet the
spreadsheet name changes from receiving rpt to receiving
rpt1. Why is the # 1 popping up? so when my macro runs it
doesn't recognize the workbooks name. By the way this
includes auto_open. Please help, i got to get this up and
running by tomorrow. Thanks
 
Donny,

The name is changed because you are opening a template, an Excel feature which is by design. If you don't want that to happen, you
can

1) save the template as a workbook. When you want a new copy, copy the workbook from wherever you are storing it.
2) write your code to not have the filename hardcoded: use ThisWorkbook.Name, etc.

HTH,
Bernie
Excel MVP
 
Back
Top