Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close and save macro
Hi...
I'm struggling with some code...I want to hit a macro button that will save changes, save the file to the desktop and close excel...I'm close but no cigar. Any help useful... Cheers Gordon. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close and save macro
Gordon,
OKI< so show us what you've got and we'll go from there. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Gordon Cartwright" wrote in message ... Hi... I'm struggling with some code...I want to hit a macro button that will save changes, save the file to the desktop and close excel...I'm close but no cigar. Any help useful... Cheers Gordon. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close and save macro
I wouldn't close excel--the user might be working on lots of other files!
Option Explicit Sub testme03() Dim wsh As Object Dim myPath As String Set wsh = CreateObject("WScript.Shell") myPath = wsh.SpecialFolders.Item("Desktop") ActiveWorkbook.SaveAs Filename:=myPath & "\" & "whateveryouwant.xls", _ FileFormat:=xlWorkbookNormal 'Application.Quit 'or just close the activeworkbook 'ActiveWorkbook.Close savechanges:=False End Sub I think a lot of users would come looking for you if running your macro caused them to lose work in other workbooks. Gordon Cartwright wrote: Hi... I'm struggling with some code...I want to hit a macro button that will save changes, save the file to the desktop and close excel...I'm close but no cigar. Any help useful... Cheers Gordon. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to save and close, then copy file | Excel Discussion (Misc queries) | |||
How to code the Macro to save and close a file? | Excel Discussion (Misc queries) | |||
Macro to save & close all opened files | Excel Discussion (Misc queries) | |||
getting same save-on-close macro to work from different networklocations | Excel Programming | |||
getting same save-on-close macro to work from different networklocations | Excel Programming |