Excel VBA: Setting a Workbook-level default save directory

I want my workbook to have a default save directory, e.g. "n:\mydirectory\hello", So each time I open it and try to save it, it will suggest this directory regardless of which other Workbooks I have saved in other paths recently.

Answers


Using the Workbook_Activate event, you can change the "current directory" with the ChDir statement so that whenever you are working within this file, the default save directory will be changed to what you want.

Note: this will only help for new files that have not yet been saved; existing files, even if you do a Save-As will default to their own directory.


Need Your Help

Delete a repeating pattern in a string using Python

python regex

I have a JavaScript file with an array of data.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.