Default Save Location

  • Thread starter Thread starter ianripping
  • Start date Start date
I

ianripping

I am using the code:

MyName = Application.Dialogs(xlDialogSaveAs).Show
If MyName = False Then MsgBox "You cancelled the Sav
operation",vbInformation, "Cancelled"

to bring up a prompt to ask where the file would like to be saved, i
there anyway of making this promt open up in a default directory? e
c:\, even if the origional file is saved in another directory, e
d:\dat
 
Ian,
you'll have to change directories before calling the proc
(vba. can be left out)

const APPPATH as string = "e:\my folder"
dim curPath as string

on error goto theend

'store current
curpath = vba.curdir

'change drive (chdrive uses first letter only)
vba.chdrive apppath
'change directory
vba.chdir apppath

do your stuff


theend: 'restore original path
vba.chdrive curpath
vba.chdir curpath




keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Chdir (as shown) would be effective if E is already the default drive. If
not, you need to change the default drive as well

ChDrive "E"
ChDir "E:\MyDir"

--
Regards,
Tom Ogilvy


Don Guillett said:
Have you tried as the first line

ChDir "e:\mydir"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top