LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Adam1 Chicago
 
Posts: n/a
Default Opening a file with a Macro

To open files with a macro, I am currently using:

Workbooks.Open Filename:= "C:\file_path.xls"

How can I use a variable as part of the file path?

In other words, before I try to open the file in my VBA code I will set a
variable (let's call it date_extension). Then I want to open a file that I
know will exist with a file path whose final characters before the .xls will
be the date_extension. How can I get the file path to be recognized with the
variable?

Thanks for your help

(P.S. I am a total novice, so I may not be familiar with commands or
procedures that are fairly basic for you folks.)

 
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
Macro warning (upon opening) Richard Excel Discussion (Misc queries) 4 February 18th 05 10:43 PM
macro error when opening any file psp Excel Discussion (Misc queries) 1 January 31st 05 04:33 PM
Problem opening an XML file in Excel - getting "ns1:macrosPresent" rprondeau Excel Discussion (Misc queries) 0 December 15th 04 03:39 PM
After deleting a macro, I still get the pop-up when opening file Anne Excel Worksheet Functions 2 December 8th 04 05:31 PM
Macro did not run after download file from net ariffin Excel Worksheet Functions 2 November 6th 04 01:20 AM


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

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

About Us

"It's about Microsoft Excel"