Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Active directory


Hi Group,

How do ID the directory that the active file is in with code?

Thanks,
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Active directory


Hi

Try this:

CurrentPath = ActiveWorkbook.Path

Regards,
Per

"David" skrev i meddelelsen
...
Hi Group,

How do ID the directory that the active file is in with code?

Thanks,
David


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Active directory


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" skrev i meddelelsen
...
Hi Group,

How do ID the directory that the active file is in with code?

Thanks,
David



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Active directory


Figured it out. Thanks


"Per Jessen" wrote:

Hi

Try this:

CurrentPath = ActiveWorkbook.Path

Regards,
Per

"David" skrev i meddelelsen
...
Hi Group,

How do ID the directory that the active file is in with code?

Thanks,
David



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
Listing Active Directory groups that have directory access rights [email protected] Excel Programming 0 October 17th 08 03:13 PM
Active directory users Dr Alric Excel Programming 5 October 27th 04 03:13 PM
active directory? Tim[_39_] Excel Programming 0 August 15th 04 08:34 AM
Active Directory Ulf Nilsson Excel Programming 2 April 27th 04 07:08 AM


All times are GMT +1. The time now is 07:05 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"