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

I'd put this in a General module:

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

That should be enough (unless the variables are cleared for some reason).

GregR wrote:

Dave, what I am trying to do is assign the variable upon opening my
personal.xls, which has a number of modules, where there is a statement
such as:

SaveAs:"C:\Documents and Settings\GregR\My Documents\" &Folder &
Filename.

When I create, or copy in most cases, a module which has a save
statement, I am constantly repeating my default dir. What I am looking
for, and maybe you have given me the answer all ready, is something
which would look like:

SaveAs: defaultdir & Folder & Filename

Is what you have given me the answer and would I declare and add the
workbook open module to my personal.xls? TIA

Greg


--

Dave Peterson