+ Reply to Thread
Results 1 to 3 of 3

Save options

  1. #1
    Forum Contributor
    Join Date
    02-24-2005
    Posts
    154

    Save options

    I have a Print macro button on my spreadsheet that sets the print area, hides certain rows and prints.
    Is there a bit of VB that will let me set up the save options much like the 'Save As' option.
    ie File name, and where to save.

  2. #2
    Ron de Bruin
    Guest

    Re: Save options

    Hi grahammal

    You can use this GetSaveAsFilename

    Example that use SaveCopyAs to save the activeworkbook

    Sub Test()
    Dim fname As Variant
    Dim Wb As Workbook
    Set Wb = ActiveWorkbook

    Again:
    fname = Application.GetSaveAsFilename("", _
    fileFilter:="Excel Files (*.xls), *.xls")
    If fname = False Then Exit Sub
    If Dir(fname) <> "" Then GoTo Again
    Wb.SaveCopyAs fname
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "grahammal" <[email protected]> wrote in message
    news:[email protected]...
    >
    > I have a Print macro button on my spreadsheet that sets the print area,
    > hides certain rows and prints.
    > Is there a bit of VB that will let me set up the save options much like
    > the 'Save As' option.
    > ie File name, and where to save.
    >
    >
    > --
    > grahammal
    > ------------------------------------------------------------------------
    > grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336
    > View this thread: http://www.excelforum.com/showthread...hreadid=518959
    >




  3. #3
    Forum Contributor
    Join Date
    02-24-2005
    Posts
    154

    Default Directory

    I have tailored your answer to my query to include the date and time.

    Dim fname As Variant
    Dim Wb As Workbook
    Set Wb = ActiveWorkbook

    Again:
    fname = Application.GetSaveAsFilename("Book6 " & Date & " " & Time, _
    fileFilter:="Excel Files (*.xls), *.xls")
    If fname = False Then Exit Sub
    If Dir(fname) <> "" Then GoTo Again
    Wb.SaveCopyAs fname

    How do I get it to always save in a default location.
    ie D:\My Documents\Excel

+ 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