Thread: Default Dir
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Default Dir

You can use a general module and declare the variable:

Option Explicit
Public DefaultDir as String

Then in some other module (workbook_open or auto_open), you can assign the value
to that variable:

Option Explicit
Sub Auto_Open()
defaultdir = "C:\Documents and Settings\GregR\My Documents\"
end sub

You don't need the Set command.

GregR wrote:

Can I declare somewhere in VBA a default directory, such as:

Dim DefaultDir as String
Set DefaultDir = "C:\Documents and Settings\GregR\My Documents\"

and have it apply to all my modules in my personal.xls. TIA

Greg


--

Dave Peterson