View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Current Directory

Another way.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

Sub FindWhatFolder()
MsgBox WhatFolder(ThisWorkbook.Path)
End Sub

Function WhatFolder(strPath) As String
Dim FSO As Object
Dim oFold As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFold = FSO.GetFolder(strPath)
WhatFolder = oFold.Path
End Function
'--------------------


"Mallasch"

wrote in message
I am writing a Macro that does some stuff then saves the file as "NAME.txt"
but the directory that I am will change with each new file. How do I grab
the directory of the active workbook? I can grab the full file path
(ActiveWorkbook.FullName) but I can not convert this to the directory. Any
help?