Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to retrieve the directory of the currently open file?

Hello,

I need to be able to retrieve the directory of the excel file which is
currently active.

"CurDir" does not work, because if excel is set to "C:\My Documents"
as the standard folder it always outputs this folder, although the
document is actually in "C:\WINDOWS\Desktop".

Can anyone help me with this?

Thanks,
Joepy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to retrieve the directory of the currently open file?

Try this Joepy

Sub test()
MsgBox ActiveWorkbook.Path
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Joepy" wrote in message om...
Hello,

I need to be able to retrieve the directory of the excel file which is
currently active.

"CurDir" does not work, because if excel is set to "C:\My Documents"
as the standard folder it always outputs this folder, although the
document is actually in "C:\WINDOWS\Desktop".

Can anyone help me with this?

Thanks,
Joepy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default How to retrieve the directory of the currently open file?

Joepy,

Try
Activeworkbook.Path

John

Joepy wrote:

Hello,

I need to be able to retrieve the directory of the excel file which is
currently active.

"CurDir" does not work, because if excel is set to "C:\My Documents"
as the standard folder it always outputs this folder, although the
document is actually in "C:\WINDOWS\Desktop".

Can anyone help me with this?

Thanks,
Joepy


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 change File Open default directory from My Documents Ben Setting up and Configuration of Excel 3 January 1st 21 12:42 PM
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


All times are GMT +1. The time now is 04:52 PM.

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"