ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save File to Another Directory, but not change Users File Save location (https://www.excelbanter.com/excel-programming/299842-save-file-another-directory-but-not-change-users-file-save-location.html)

Mike Knight

Save File to Another Directory, but not change Users File Save location
 
From Excel toolbar, A user's current "File Save As" location is
\\Server1\UsersName\Documents.

After my code saves the open workbook (ActiveWorkbook.SaveAs Filename)
to \\Server2\MyName\Documents, the next time the user does "File Save
As" from an Excel toolbar, the location seen is
\\Server2\Myname\Documents.

How can I store the users's current "File Save As" path, run code, and
restore the user's current "File Save As" path?

In other words, the next time the users selects "File Save As", no
directory path changes will be noticed.

Thanks,
Mike

jaf

Save File to Another Directory, but not change Users File Save location
 
Hi Mike,
This happens without closing Excel? That the was SaveAs works. Your renaming
the running file.
A simple work around is to use the SaveCopyAs method instead.

ActiveWorkbook.SaveCopyAs " \\Server2\MyName\Documents"


--
John
johnf 202 at hotmail dot com


"Mike Knight" wrote in message
om...
| From Excel toolbar, A user's current "File Save As" location is
| \\Server1\UsersName\Documents.
|
| After my code saves the open workbook (ActiveWorkbook.SaveAs Filename)
| to \\Server2\MyName\Documents, the next time the user does "File Save
| As" from an Excel toolbar, the location seen is
| \\Server2\Myname\Documents.
|
| How can I store the users's current "File Save As" path, run code, and
| restore the user's current "File Save As" path?
|
| In other words, the next time the users selects "File Save As", no
| directory path changes will be noticed.
|
| Thanks,
| Mike




All times are GMT +1. The time now is 10:44 AM.

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