Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Default Save Location

Thanks that works

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save to a location other than default RMires Excel Discussion (Misc queries) 6 June 4th 09 02:55 PM
Macro - save to current location vs excel default location leezard Excel Discussion (Misc queries) 0 October 28th 08 03:04 PM
Default save as location in Microsoft Query ngg Excel Discussion (Misc queries) 0 August 8th 08 08:43 PM
default save location on network Steve_n_KC Excel Discussion (Misc queries) 1 August 23rd 07 01:38 AM
Changed Excel 2003 startup now won't save to default location Beach Lover Excel Discussion (Misc queries) 11 June 28th 07 06:27 PM


All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"