Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save copy on close ?
Hi.
I have a workbook that is on a shared drive. Is there anyway that I can program it to save on to desktop on close? (No matter who uses it, I want it to autmatically save a copy onto their desktop when they close it - without asking them if they want to). Thanx |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save copy on close ?
On 22 Sep, 15:19, "J.W. Aldridge" wrote:
Hi. I have a workbook that is on a shared drive. Is there anyway that I can program it to save on to desktop on close? (No matter who uses it, I want it to autmatically save a copy onto their desktop when they close it - without asking them if they want to). Thanx Hi, You will need to put something in the before close event. So this isn't in a standard module but in the "Thisworkbook" module, then select workbook, before close (use the drop downs at the top of the screen). As the desktop location changes with the different versions of the operating system you will need to shell out to get the location, the following code should do the trick: Private Sub Workbook_BeforeClose(Cancel As Boolean) Set WshShell = CreateObject("WScript.Shell") ThisWorkbook.SaveAs Filename:=WshShell.SpecialFolders("Desktop") & "\" & ThisWorkbook.Name End Sub James |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to save and close, then copy file | Excel Discussion (Misc queries) | |||
Save a copy from cell data and close orignal | Excel Programming | |||
copy tabs into new workbook, save, and close. | Excel Programming | |||
To save and close | Excel Worksheet Functions | |||
Save as .txt then close | Excel Programming |