Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default Open files in the same directory

At this moment I use something like:

Set RptWkbk = Workbooks.Open(Filename:="Y:\ALL_USERS\Username\St atistics\Department 01\Individual Report.XLS")
I have another file open in the same directory that does the above and
that works wonders.

However I would like it to point to the file with the name "Individual
Report.XLS", but without the drive and such, so I can send it to people
who are on a different machine.

I tried the following, but it did not work:
Set RptWkbk = Workbooks.Open(Filename:="Individual Report.XLS")

Probably prety basic stuff, but I can't seem to figure it out.

houghi
--
Let's not be too tough on our own ignorance. It's the thing that makes
America great. If America weren't incomparably ignorant, how could we
have tolerated the last eight years? -- Frank Zappa, in 1988
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Open files in the same directory

Can you make sure that the workbook is in the same folder as the workbook
running the code:

Set RptWkbk = Workbooks.Open(Filename:=thisworkbook.path & "\" & _
"Individual Report.XLS")

or if you know that file is in the same workbook that is currently active

Set RptWkbk = Workbooks.Open(Filename:=activeworkbook.path & "\" & _
"Individual Report.XLS")



houghi wrote:

At this moment I use something like:

Set RptWkbk = Workbooks.Open(Filename:="Y:\ALL_USERS\Username\St atistics\Department 01\Individual Report.XLS")
I have another file open in the same directory that does the above and
that works wonders.

However I would like it to point to the file with the name "Individual
Report.XLS", but without the drive and such, so I can send it to people
who are on a different machine.

I tried the following, but it did not work:
Set RptWkbk = Workbooks.Open(Filename:="Individual Report.XLS")

Probably prety basic stuff, but I can't seem to figure it out.

houghi
--
Let's not be too tough on our own ignorance. It's the thing that makes
America great. If America weren't incomparably ignorant, how could we
have tolerated the last eight years? -- Frank Zappa, in 1988


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default Open files in the same directory

Dave Peterson wrote:
Can you make sure that the workbook is in the same folder as the workbook
running the code:

Set RptWkbk = Workbooks.Open(Filename:=thisworkbook.path & "\" & _
"Individual Report.XLS")


Works great, thanks.

houghi
--
Let's not be too tough on our own ignorance. It's the thing that makes
America great. If America weren't incomparably ignorant, how could we
have tolerated the last eight years? -- Frank Zappa, in 1988
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
Macro - Open all word files in a directory Dileep Chandran Excel Worksheet Functions 11 December 19th 06 02:12 PM
List of Files in A Directory JaneC Excel Discussion (Misc queries) 2 February 18th 06 12:11 PM
Backup files in separate directory? Martyn B Tindall Excel Worksheet Functions 1 December 1st 05 12:02 AM
Files in a directory? Greg B Excel Discussion (Misc queries) 5 May 11th 05 09:46 PM
Load all files in a directory Greg B... Excel Discussion (Misc queries) 2 March 2nd 05 12:22 PM


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