Hello Per,
I thought all I needed was what you provided to do what I wanted to do,
which is to open all the files in the current directory. This is what I was
hoping would work, but it is not:
Sub OpenAllFiles()
'David Lanman 5/2/2009
Dim strFile
Dim strFolder
strFolder = ActiveWorkbook.Path
strFolderSave = ActiveWorkbook.Path
strFile = Dir(strFolder & "*.*", vbNormal)
Do While strFile <> ""
MsgBox strFile
Workbooks.Open Filename:= _
strFolder & strFile
'do something
ActiveWorkbook.SaveAs Filename:= _
strFolderSave & "/" & strFile
ActiveWorkbook.Close
strFile = Dir
Loop
End Sub
The strFile is empty. There is extra code, in that when I save it will be to
the same directory.
Thanks for your help,
David
"Per Jessen" wrote:
> Hi
>
> Try this:
>
> CurrentPath = ActiveWorkbook.Path
>
> Regards,
> Per
>
> "David" <(E-Mail Removed)> skrev i meddelelsen
> news:5F69EB05-5FEA-401C-9E5E-(E-Mail Removed)...
> > Hi Group,
> >
> > How do ID the directory that the active file is in with code?
> >
> > Thanks,
> > David
>
>
|