+ Reply to Thread
Results 1 to 6 of 6

Savename suggestion

  1. #1
    Jan Kronsell
    Guest

    Savename suggestion

    I try to put my own filename suggestion into the SaveAs dialog.

    I have tried something like this

    strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    Application.GetSaveAsFilename strfilename

    And it gets my name from the sheet allright.

    But if i put it in the BeforeSave event the dialog is display on Save as
    well as SaveAs. And using SaveAs the dialog is shown twice.

    What can I do to put my own name suggestion into the standard FileSaveAs
    dialog?

    Jan




  2. #2
    Sandy
    Guest

    Re: Savename suggestion

    Try

    strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    ActiveWorkbook.SaveAs Filename:= strfilename

    in the BeforeClose event

    "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
    news:[email protected]...
    >I try to put my own filename suggestion into the SaveAs dialog.
    >
    > I have tried something like this
    >
    > strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    > Application.GetSaveAsFilename strfilename
    >
    > And it gets my name from the sheet allright.
    >
    > But if i put it in the BeforeSave event the dialog is display on Save as
    > well as SaveAs. And using SaveAs the dialog is shown twice.
    >
    > What can I do to put my own name suggestion into the standard FileSaveAs
    > dialog?
    >
    > Jan
    >
    >
    >




  3. #3
    Jan Kronsell
    Guest

    Re: Savename suggestion

    Thanks Sandy, but you code saves the workbook. I just want the SaveAs dialog
    displayed, with a default name of my own, so the user still will be able to
    change it, if so pleases.

    Jan


    "Sandy" <[email protected]> skrev i en meddelelse
    news:[email protected]...
    > Try
    >
    > strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    > ActiveWorkbook.SaveAs Filename:= strfilename
    >
    > in the BeforeClose event
    >
    > "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
    > news:[email protected]...
    >>I try to put my own filename suggestion into the SaveAs dialog.
    >>
    >> I have tried something like this
    >>
    >> strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    >> Application.GetSaveAsFilename strfilename
    >>
    >> And it gets my name from the sheet allright.
    >>
    >> But if i put it in the BeforeSave event the dialog is display on Save as
    >> well as SaveAs. And using SaveAs the dialog is shown twice.
    >>
    >> What can I do to put my own name suggestion into the standard FileSaveAs
    >> dialog?
    >>
    >> Jan
    >>
    >>
    >>

    >
    >




  4. #4
    Rookie 1st class
    Guest

    Re: Savename suggestion

    Hi Jan
    You may be able to adapt this to your needs, I wanted a back-up copy with a
    different name and path because existing forms are over written without
    changing the name, thus messing up 2 forms.

    Response = MsgBox(Prompt:="Would You Like to Create a Back-Up Copy?",
    Buttons:=vbYesNoCancel + vbDefaultButton1, Title:="BACK-UP COPY")
    If Response = vbYes Then
    ActiveSheet.Unprotect
    BookName = ActiveWorkbook.Name ' Cell outside of print area
    Range("BckUp").Select ' Copy of calibration or recall date depending
    - also outside print area, in mm-dd-yy format.
    Selection = ClearContents
    Selection = InputBox(Prompt:="Your Back-Up Form Name Will Be Like
    the Window Below.", Title:="BACK-UP COPY", Default:=Range("BckUpDt").Text + "
    " + (BookName))
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
    Scenarios:=True
    If ActiveWorkbook.Saved = False Then ActiveWorkbook.Save
    ChDir "\YOUR DIRECTORY\Current Year"
    ActiveWorkbook.SaveCopyAs FileName:=Range("BckUp").Text
    ChDir "\YOUR DIRECTORY\DEFALT PATH"

    Please let me know if it helped and your modification. I may want to utilize
    them elsewhere myself
    Lou


    "Jan Kronsell" wrote:

    > Thanks Sandy, but you code saves the workbook. I just want the SaveAs dialog
    > displayed, with a default name of my own, so the user still will be able to
    > change it, if so pleases.
    >
    > Jan
    >
    >
    > "Sandy" <[email protected]> skrev i en meddelelse
    > news:[email protected]...
    > > Try
    > >
    > > strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    > > ActiveWorkbook.SaveAs Filename:= strfilename
    > >
    > > in the BeforeClose event
    > >
    > > "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
    > > news:[email protected]...
    > >>I try to put my own filename suggestion into the SaveAs dialog.
    > >>
    > >> I have tried something like this
    > >>
    > >> strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    > >> Application.GetSaveAsFilename strfilename
    > >>
    > >> And it gets my name from the sheet allright.
    > >>
    > >> But if i put it in the BeforeSave event the dialog is display on Save as
    > >> well as SaveAs. And using SaveAs the dialog is shown twice.
    > >>
    > >> What can I do to put my own name suggestion into the standard FileSaveAs
    > >> dialog?
    > >>
    > >> Jan
    > >>
    > >>
    > >>

    > >
    > >

    >
    >
    >


  5. #5
    Tom Ogilvy
    Guest

    Re: Savename suggestion

    Set cancel to true in the BeforeSave event, then disable events and perform
    the save using the name returned from your prompt.
    Now enable events again.
    --
    Regards,
    Tom Ogilvy



    "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
    news:[email protected]...
    > Thanks Sandy, but you code saves the workbook. I just want the SaveAs

    dialog
    > displayed, with a default name of my own, so the user still will be able

    to
    > change it, if so pleases.
    >
    > Jan
    >
    >
    > "Sandy" <[email protected]> skrev i en meddelelse
    > news:[email protected]...
    > > Try
    > >
    > > strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    > > ActiveWorkbook.SaveAs Filename:= strfilename
    > >
    > > in the BeforeClose event
    > >
    > > "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
    > > news:[email protected]...
    > >>I try to put my own filename suggestion into the SaveAs dialog.
    > >>
    > >> I have tried something like this
    > >>
    > >> strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    > >> Application.GetSaveAsFilename strfilename
    > >>
    > >> And it gets my name from the sheet allright.
    > >>
    > >> But if i put it in the BeforeSave event the dialog is display on Save

    as
    > >> well as SaveAs. And using SaveAs the dialog is shown twice.
    > >>
    > >> What can I do to put my own name suggestion into the standard

    FileSaveAs
    > >> dialog?
    > >>
    > >> Jan
    > >>
    > >>
    > >>

    > >
    > >

    >
    >




  6. #6
    Jan Kronsell
    Guest

    Re: Savename suggestion

    Thank you all. In used Tom's solution.

    Jan

    "Tom Ogilvy" <[email protected]> skrev i en meddelelse
    news:[email protected]...
    > Set cancel to true in the BeforeSave event, then disable events and
    > perform
    > the save using the name returned from your prompt.
    > Now enable events again.
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
    > news:[email protected]...
    >> Thanks Sandy, but you code saves the workbook. I just want the SaveAs

    > dialog
    >> displayed, with a default name of my own, so the user still will be able

    > to
    >> change it, if so pleases.
    >>
    >> Jan
    >>
    >>
    >> "Sandy" <[email protected]> skrev i en meddelelse
    >> news:[email protected]...
    >> > Try
    >> >
    >> > strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    >> > ActiveWorkbook.SaveAs Filename:= strfilename
    >> >
    >> > in the BeforeClose event
    >> >
    >> > "Jan Kronsell" <kronsell(nomorespam)@adslhome.dk> wrote in message
    >> > news:[email protected]...
    >> >>I try to put my own filename suggestion into the SaveAs dialog.
    >> >>
    >> >> I have tried something like this
    >> >>
    >> >> strfilename = sSeets(1).Range("b1") & Sheets(1)Range("c1")
    >> >> Application.GetSaveAsFilename strfilename
    >> >>
    >> >> And it gets my name from the sheet allright.
    >> >>
    >> >> But if i put it in the BeforeSave event the dialog is display on Save

    > as
    >> >> well as SaveAs. And using SaveAs the dialog is shown twice.
    >> >>
    >> >> What can I do to put my own name suggestion into the standard

    > FileSaveAs
    >> >> dialog?
    >> >>
    >> >> Jan
    >> >>
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




+ 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