Soft-coding document name?

  • Thread starter Thread starter Rick Charnes
  • Start date Start date
R

Rick Charnes

We have the following line in an Excel macro

Windows("May 06 Outlook - prelim.xls").Activate

I believe the macro is attached to the document "May 06 Outlook -
prelim.xls". Next month this doc will be modified and renamed to "June
07 - prelim.xls". Is there a way to soft-code the document name (into a
variable?) here so that every time this macro is run the variable
expands to the doc name?
 
Surely, if that code is in the workbook, when you open it it will already
be active, so the code is unnecessary?

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
Windows(format(Date,"mmmm yy") & " Outlook - prelim.xls").Activate

HTH
 
Does this mean that the line of code is in the workbook named:
"May 06 Outlook - prelim.xls"

If yes, you can use:
Thisworkbook.activate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top