Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Local Directory File Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alejandro - 31 Mar 2006 19:41 GMT
Hello all,

I am trying to get a macro to open a file in the same directory as the xl
file being launched.  The code I am using is:
   Workbooks.Open Filename:="DB-Data.xls"

For some reason it doesn't want to find it [although the help file says that
it should].  If I give it a full path, it has no problem.  Is it possible to
do this?  My goal is to get these workbooks available on CD for people to
work at home.

Thanks,
-=Alejandro
Jim Thomlinson - 31 Mar 2006 23:11 GMT
Thisworkbook.path

will give you the path to the workbook running the code...
Signature

HTH...

Jim Thomlinson

> Hello all,
>
[quoted text clipped - 9 lines]
> Thanks,
> -=Alejandro
Alejandro - 31 Mar 2006 23:29 GMT
Jim,

Thanks for the suggestion!  That helped a lot.  It works now, with the
addition of a '\' in front of the file name in the code, as such:
   Workbooks.Open Filename:=(ThisWorkbook.Path & "\DB-Data.xls")

It worked great!

-=Alejandro

> Thisworkbook.path
>
[quoted text clipped - 15 lines]
>> Thanks,
>> -=Alejandro
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.