Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
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/ |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default Save Location
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save to a location other than default | Excel Discussion (Misc queries) | |||
Macro - save to current location vs excel default location | Excel Discussion (Misc queries) | |||
Default save as location in Microsoft Query | Excel Discussion (Misc queries) | |||
default save location on network | Excel Discussion (Misc queries) | |||
Changed Excel 2003 startup now won't save to default location | Excel Discussion (Misc queries) |