Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Open file in directory

Hi. The following code will open a file in a specific
directory. After I complete the development of this
file, I plan to move it along with the other file to
another computer. At this point, I don't know the entire
path on the new computer, but I do know that both files
will reside in the same directory.

How would I rewrite this line so that it will open the
file in the same directory as that which the macro file
is located?

Workbooks.Open Filename:= _
"C:\Documents and Settings\Mike\My
Documents\Demos Log file.xls"

Thanks,
Mike.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Open file in directory

Workbooks.Open Filename:= _
ThisWorkbook.Path & "\" & "Demos Log file.xls"

--
Regards,
Tom Ogilvy

"Mike" wrote in message
...
Hi. The following code will open a file in a specific
directory. After I complete the development of this
file, I plan to move it along with the other file to
another computer. At this point, I don't know the entire
path on the new computer, but I do know that both files
will reside in the same directory.

How would I rewrite this line so that it will open the
file in the same directory as that which the macro file
is located?

Workbooks.Open Filename:= _
"C:\Documents and Settings\Mike\My
Documents\Demos Log file.xls"

Thanks,
Mike.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Open file in directory

Thanks, Tom.

-----Original Message-----
Workbooks.Open Filename:= _
ThisWorkbook.Path & "\" & "Demos Log file.xls"

--
Regards,
Tom Ogilvy

"Mike" wrote in

message
...
Hi. The following code will open a file in a specific
directory. After I complete the development of this
file, I plan to move it along with the other file to
another computer. At this point, I don't know the

entire
path on the new computer, but I do know that both files
will reside in the same directory.

How would I rewrite this line so that it will open the
file in the same directory as that which the macro file
is located?

Workbooks.Open Filename:= _
"C:\Documents and Settings\Mike\My
Documents\Demos Log file.xls"

Thanks,
Mike.




.

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
How do I set up an Excel 2007 default directory for a File Open? Lynn Excel Discussion (Misc queries) 1 April 15th 08 05:30 PM
open file in current directory Tomo Excel Worksheet Functions 1 January 12th 08 12:04 AM
open file in current directory Tomo Excel Discussion (Misc queries) 1 January 11th 08 11:48 PM
Excel Slow File Open Directory Response Dave P Excel Discussion (Misc queries) 0 September 30th 05 01:37 AM
How to retrieve the directory of the currently open file? Joepy Excel Programming 2 August 7th 03 03:02 PM


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