[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Chaning the Excel 2003 Save Path

Posted on 2006-05-03
5
Medium Priority
?
344 Views
Last Modified: 2008-01-09
For Word, there is a nice simple vb function called FileSaveChangeDirectory, which resets all the file paths to look wherever you want.

From what I can tell, in Excel ChDir does much the same. However, when I go to File>Save As in the Excel menu, it always defaults back to where the current document is stored (XLSTART for a new document, as that's where the template document is stored). Is there any way to stop this?


Note 1) If I call CurDir in the before save event, it returns the correct directory. When the save dialog gets called, it's reverted back to the saved file location.

Note 2) On File>Open, the dialog opens in the correct directory. Once the save dialog has been called (even when cancelling it), the CurDir reverts back to the saved file location.

Note 3) Yes, I am using ChDrive as well. No, it's not helping.
0
Comment
Question by:SWOne
  • 2
2 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 1000 total points
ID: 16594409
Hello SWOne,

not sure if this is helping since you do not mention user interaction in saving the file but you could set the path + filename in a box while calling the save

---------
Dim fileSaveName As Variant
  fileSaveName = Application.GetSaveAsFilename(InitialFileName:="f:\thisismyfolder\data\myFile.csv", fileFilter:="CSV (*.csv), *.txt")
  If fileSaveName = False Then
    Exit Sub
  End If
---------

hope this helps a bit
bruintje
0
 
LVL 44

Expert Comment

by:bruintje
ID: 16877182
i think my comment does help, BUT it would be good to hear from the asker
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question