Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to get file's current directory path to a string in VBA?

In my VBA I needed to get some data from another Excel
file located in the same directory with current host excel
file.How could I got the current file's path ,something
the same as "../" in UNIX?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default How to get file's current directory path to a string in VBA?

Sub test()
Dim sPath As String
sPath = ActiveWorkbook.Path
MsgBox sPath
End Sub

--
HTH. Best wishes Harald
Followup to newsgroup only please.

" wrote in message
...
In my VBA I needed to get some data from another Excel
file located in the same directory with current host excel
file.How could I got the current file's path ,something
the same as "../" in UNIX?
Thanks!



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 add a window bar in the menu to show the file's unc path Steve M Setting up and Configuration of Excel 2 January 5th 07 05:09 AM
Excel 2k3 query path to current directory busypgmr Excel Discussion (Misc queries) 1 September 5th 06 10:05 PM
Dynamic directory path Newbie Excel Discussion (Misc queries) 1 April 24th 06 04:56 PM
Target directory & Path Param Excel Worksheet Functions 0 March 28th 06 01:52 AM
Obtain full path to a directory pk Excel Programming 2 September 29th 03 07:07 PM


All times are GMT +1. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"