LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to read filename in cell and open new file


Dim fileName As String

fileName = Range("A1") ' or whatever cell your data is in

Workbooks.Open(fileName)

that should do the trick... be sure to make certain it won't ever tr
to open non-existant files.

if len(Dir(fileName)) = 0 then
MsgBox("File does not exist")
else
Workbooks.Open(fileName)
End If

or something like tha

--
TommySzalapsk
-----------------------------------------------------------------------
TommySzalapski's Profile: http://www.excelforum.com/member.php...fo&userid=2556
View this thread: http://www.excelforum.com/showthread.php?threadid=39055

 
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 to open most recent file with a particular filename string kwiklearner Excel Discussion (Misc queries) 1 August 23rd 06 01:24 AM
Why doesn't the File Open list sort into filename order? cycler New Users to Excel 7 July 16th 05 06:44 PM
How to write a macro to open a file read-only? Mark Seger Excel Programming 20 June 5th 05 05:31 PM
Need macro to open a variable filename Steve@ABS Excel Programming 5 June 2nd 05 09:08 PM
Macro to open SaveAs... and change filename to cell value Andy Excel Programming 5 July 19th 04 12:23 PM


All times are GMT +1. The time now is 05: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"