View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
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!