Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Office 2003 on Windows XP.
I want to use a Before_Save event that: Forces the "Save As" dialog box to open to "C:\" with the contents of the variable sFileName as the default file name. Can someone please show me example code on how to work the arguments in the Before_Save event to do this? Thanks much. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
On Error GoTo ErrorHandler Application.EnableEvents = False Cancel = True Application.Dialogs(xlDialogSaveAs).Show "C:\This.xls" ErrorHandler: Application.EnableEvents = True End Sub -- HTH... Jim Thomlinson "quartz" wrote: I am using Office 2003 on Windows XP. I want to use a Before_Save event that: Forces the "Save As" dialog box to open to "C:\" with the contents of the variable sFileName as the default file name. Can someone please show me example code on how to work the arguments in the Before_Save event to do this? Thanks much. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
Thanks again. Your solution works, except it does not change the default to "C". The file name is there, but the path is not changed...how can I modify? "Jim Thomlinson" wrote: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) On Error GoTo ErrorHandler Application.EnableEvents = False Cancel = True Application.Dialogs(xlDialogSaveAs).Show "C:\This.xls" ErrorHandler: Application.EnableEvents = True End Sub -- HTH... Jim Thomlinson "quartz" wrote: I am using Office 2003 on Windows XP. I want to use a Before_Save event that: Forces the "Save As" dialog box to open to "C:\" with the contents of the variable sFileName as the default file name. Can someone please show me example code on how to work the arguments in the Before_Save event to do this? Thanks much. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
I got it running based on what you gave me, thanks. "quartz" wrote: Jim, Thanks again. Your solution works, except it does not change the default to "C". The file name is there, but the path is not changed...how can I modify? "Jim Thomlinson" wrote: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) On Error GoTo ErrorHandler Application.EnableEvents = False Cancel = True Application.Dialogs(xlDialogSaveAs).Show "C:\This.xls" ErrorHandler: Application.EnableEvents = True End Sub -- HTH... Jim Thomlinson "quartz" wrote: I am using Office 2003 on Windows XP. I want to use a Before_Save event that: Forces the "Save As" dialog box to open to "C:\" with the contents of the variable sFileName as the default file name. Can someone please show me example code on how to work the arguments in the Before_Save event to do this? Thanks much. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with Before_Save Macro | Excel Discussion (Misc queries) | |||
How to trap delete row event and hide column event? | Excel Programming | |||
user form-on open event? keydown event? | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming | |||
Need Before_Save code | Excel Programming |