Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Rick Charnes
 
Posts: n/a
Default Soft-coding document name?

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Soft-coding document 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)

"Rick Charnes" wrote in message
om...
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?



  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Soft-coding document name?

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





Rick Charnes wrote:

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?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficult for me, probably basic to you onlyjohn Excel Worksheet Functions 1 February 3rd 06 06:14 PM
Word found no merge fields in your main document. lburg801 Excel Discussion (Misc queries) 0 November 28th 05 09:01 PM
Help: Can't display contents of Adobe Acrobat Document in Sheet Dab Excel Discussion (Misc queries) 1 October 4th 05 02:20 AM
How to embed Word document into Excel and retain sizing, formatti. Kent Excel Discussion (Misc queries) 0 February 2nd 05 08:37 PM
Hyperlink to a word document JS Excel Discussion (Misc queries) 1 December 10th 04 11:49 PM


All times are GMT +1. The time now is 09:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"