ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Default Save Location (https://www.excelbanter.com/excel-programming/302118-default-save-location.html)

ianripping[_72_]

Default Save Location
 
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

--
Message posted from http://www.ExcelForum.com


Don Guillett[_4_]

Default Save Location
 
Have you tried as the first line

ChDir "e:\mydir"
--
Don Guillett
SalesAid Software

"ianripping " wrote in message
...
I am using the code:

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

to bring up a prompt to ask where the file would like to be saved, is
there anyway of making this promt open up in a default directory? eg
c:\, even if the origional file is saved in another directory, eg
d:\data


---
Message posted from
http://www.ExcelForum.com/




keepITcool

Default Save Location
 
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


ianripping wrote:

I am using the code:

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

to bring up a prompt to ask where the file would like to be saved, is
there anyway of making this promt open up in a default directory? eg
c:\, even if the origional file is saved in another directory, eg
d:\data


---
Message posted from http://www.ExcelForum.com/




Tom Ogilvy

Default Save Location
 
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" wrote in message
...
Have you tried as the first line

ChDir "e:\mydir"
--
Don Guillett
SalesAid Software

"ianripping " wrote in message
...
I am using the code:

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

to bring up a prompt to ask where the file would like to be saved, is
there anyway of making this promt open up in a default directory? eg
c:\, even if the origional file is saved in another directory, eg
d:\data


---
Message posted from
http://www.ExcelForum.com/






ianripping[_73_]

Default Save Location
 
Thanks that works

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 08:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com