Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Save dialog box

On Nov 27, 8:57*am, Per Jessen wrote:
The event macro will be called when MySave macro is executed. To avoid
the call to the Workbook_BeforeSave event, you can use the code as
below:

'*** In the module insert use this ***
'*** Notice that the Public declared variable has to be at the very
top of the module***
Public DisableSaveEvent As Boolean
Sub MySave()
Dim MyFileName As String
ChDir "S:\CCAS\DC\Reablement Team Goal Plans Etc\2 SPICE SHEETS"
MyFileName = Application.GetSaveAsFilename

If MyFileName = "false" Then Exit Sub
DisableSaveEvent = True
ActiveWorkbook.SaveAs MyFileName
End Sub

'*** In ThisWorkbook module use this code ***
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If DisableSaveEvent Then Exit Sub
ChDir "C:\Temp" 'Path to save copy to
Do
* * fName = Application.GetSaveAsFilename("", fName =
Application.GetSaveAsFilename("", "Excel Files (*.xls), *.xls", ,
"Enter filename"), , "Enter filename")
Loop Until fName < "false"
Debug.Print fName
ThisWorkbook.SaveCopyAs fName
Cancel = True
End Sub

Regards,
Per



Hi


thanks - cant get it work yet *- might it being in conflict with
another macro in the "module"


Sub MySave()


Dim MyFileName As String
ChDir "S:\CCAS\DC\Reablement Team Goal Plans Etc\2 SPICE SHEETS"
MyFileName = Application.GetSaveAsFilename
If MyFileName = "false" Then Exit Sub
ActiveWorkbook.SaveAs MyFileName
End Sub


thanks


Johnny- Skjul tekst i anførselstegn -


- Vis tekst i anførselstegn -


Thanks - will check it out in work next week and let you know how I
get on.

much appreciated

John
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
Save Excel Worksheet As CSV - No Save As Dialog SQLServant Excel Programming 1 September 29th 06 12:36 PM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
Changing Save As Type in Save as dialog box Phill Excel Programming 2 August 22nd 03 12:38 PM
Save As Dialog Arne[_2_] Excel Programming 0 July 9th 03 09:18 AM


All times are GMT +1. The time now is 07:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"