Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Before_Save event

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Before_Save event

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Before_Save event

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Before_Save event

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
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
Problem with Before_Save Macro Jay Excel Discussion (Misc queries) 5 May 18th 06 06:47 PM
How to trap delete row event and hide column event? Alan Excel Programming 3 April 26th 05 04:25 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM
Need Before_Save code Phil Hageman Excel Programming 13 July 10th 03 11:55 AM


All times are GMT +1. The time now is 03:09 AM.

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"