Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default 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
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
Macro to save and close, then copy file NewSysAdmin Excel Discussion (Misc queries) 2 December 2nd 09 03:24 PM
Save a copy from cell data and close orignal Dando265 Excel Programming 5 June 15th 07 03:54 PM
copy tabs into new workbook, save, and close. [email protected] Excel Programming 2 April 20th 07 04:01 PM
To save and close Steved Excel Worksheet Functions 5 July 27th 05 12:17 AM
Save as .txt then close Ryan Excel Programming 1 April 16th 04 08:16 AM


All times are GMT +1. The time now is 07:30 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"