Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: how to programmatically use "Save As" in macro???

  1. #1
    New Member
    Join Date
    Apr 2002
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    here's the problem:

    When a user click on an assigned button, i would like to do the following:

    1. Present the user with a "Save As" dialog box, BUT with a specific folder location (not the default dir) so users do not have to navigate further...
    (So far, I can only do the 1st part)

    2. User types a filename and click save

    3. Continues with the rest of the macro, i.e. Saves the file as HTML...

    Thank you...

  2. #2
    MrExcel MVP Ivan F Moala's Avatar
    Join Date
    Feb 2002
    Location
    Auckland, New Zealand
    Posts
    4,209
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-11 23:23, xenium wrote:
    here's the problem:

    When a user click on an assigned button, i would like to do the following:

    1. Present the user with a "Save As" dialog box, BUT with a specific folder location (not the default dir) so users do not have to navigate further...
    (So far, I can only do the 1st part)

    2. User types a filename and click save

    3. Continues with the rest of the macro, i.e. Saves the file as HTML...

    Thank you...
    Here's one way to do it;
    Look up Help file for more info.


    Sub MySaveAs()
    Dim sFileSave As String
    Dim sFileFrmt As String

    '// Define your format here
    sFileFrmt = "xls"
    '// Define your Dir to saveto here
    ChDir ("C:AAText")

    sFileSave = Application.GetSaveAsFilename
    If sFileSave = "False" Then Exit Sub

    On Error GoTo ErrSave
    ActiveWorkbook.SaveAs (sFileSave & sFileFrmt)

    Exit Sub
    ErrSave:
    MsgBox Err.Number & vbCr & _
    Err.Description & vbCr _
    , vbMsgBoxHelpButton, "Error", Err.HelpFile, Err.HelpContext
    End Sub



    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    thank you... you're a great help!

    I'll be able to adapt it (the macro) further with your macro as a guide...

    Thanks again!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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