PC Review


Reply
Thread Tools Rate Thread

changing current directory to that of the current open file

 
 
unnameable
Guest
Posts: n/a
 
      19th May 2004
Hi,

I'm working on an invoicing project which involves three seperat
spreadsheet files. The main file opens the other two via a macro.

My problem is, I can't find a way to make the current directory (usin
ChDir or the like) the directory in which the main file is present!

I know it probably would be alright if I opened the main file usin
File>Open in the Excel menu, but I would like it to work if the file i
opened direct by double clicking on it in windows explorer.

Say the file is C:\Invoicing\OrderForm.xls ... how would I make th
current directory C:\Invoicing via a macro without actually naming th
directory? I don't want it to be a permanent thing, I only want it t
happen when the spreadsheet is opened.

Any ideas

--
Message posted from http://www.ExcelForum.com

 
Reply With Quote
 
 
 
 
unnameable
Guest
Posts: n/a
 
      19th May 2004
I've re-read my post above and it seems a little jumbled!! Here'
another try at explaining my problem....

When I open the OrderForm.xls file from the folder itself, I want
macro within it to set the folder it is in to the current directory.

At the moment when I open the file this way the current director
remains as 'My Documents'.

I know the current directory changes if I open the file via the Fil
menu in Excel, but ideally I'd like it to change in both situations...

--
Message posted from http://www.ExcelForum.com

 
Reply With Quote
 
Cecilkumara Fernando
Guest
Posts: n/a
 
      19th May 2004
May be,
chdir cstr(activeworkbook.path)
Cecil

"unnameable >" <<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I'm working on an invoicing project which involves three seperate
> spreadsheet files. The main file opens the other two via a macro.
>
> My problem is, I can't find a way to make the current directory (using
> ChDir or the like) the directory in which the main file is present!
>
> I know it probably would be alright if I opened the main file using
> File>Open in the Excel menu, but I would like it to work if the file is
> opened direct by double clicking on it in windows explorer.
>
> Say the file is C:\Invoicing\OrderForm.xls ... how would I make the
> current directory C:\Invoicing via a macro without actually naming the
> directory? I don't want it to be a permanent thing, I only want it to
> happen when the spreadsheet is opened.
>
> Any ideas?
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
open file in current directory Tomo Microsoft Excel Worksheet Functions 1 12th Jan 2008 12:04 AM
open file in current directory Tomo Microsoft Excel Programming 1 11th Jan 2008 11:49 PM
open file in current directory Tomo Microsoft Excel Misc 1 11th Jan 2008 11:48 PM
changing current directory Steph Microsoft Access 0 6th Jun 2006 10:16 PM
.NET app is changing current directory John Bauer Microsoft Dot NET 1 29th Oct 2003 05:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:21 PM.