+ Reply to Thread
Results 1 to 4 of 4

Before_Save event

  1. #1
    quartz
    Guest

    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. #2
    Jim Thomlinson
    Guest

    RE: 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. #3
    quartz
    Guest

    RE: 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. #4
    quartz
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1