+ Reply to Thread
Results 1 to 5 of 5

Directing a Save As in VBA

  1. #1
    Registered User
    Join Date
    05-25-2005
    Posts
    6

    Directing a Save As in VBA

    Hi,

    I am working on a tool, and when it opens I want it to immediatly do a save as (I have it read only, and can get the save as to come up, but i don't want anyone saving the tool where the save as pops up, I want it to co to their C/Data folder).

    The last line in my auto open vba code is below, and that brings up the save as screen, but i want to direct it to go to C/Data, any help would be appreciated.

    "Application.Dialogs(xlDialogSaveAs).Show"

  2. #2
    RonaldF
    Guest

    RE: Directing a Save As in VBA

    ChDrive C
    ChDir C:\Data folder

    --
    Ronald Ferdinandus
    http://www.ro-pay.nl


    "ngarland13" wrote:

    >
    > Hi,
    >
    > I am working on a tool, and when it opens I want it to immediatly do a
    > save as (I have it read only, and can get the save as to come up, but i
    > don't want anyone saving the tool where the save as pops up, I want it
    > to co to their C/Data folder).
    >
    > The last line in my auto open vba code is below, and that brings up the
    > save as screen, but i want to direct it to go to C/Data, any help would
    > be appreciated.
    >
    > "Application.Dialogs(xlDialogSaveAs).Show"
    >
    >
    > --
    > ngarland13
    > ------------------------------------------------------------------------
    > ngarland13's Profile: http://www.excelforum.com/member.php...o&userid=23713
    > View this thread: http://www.excelforum.com/showthread...hreadid=401212
    >
    >


  3. #3
    Registered User
    Join Date
    05-25-2005
    Posts
    6

    VBA question

    Thanks, but I couldn't get that to work. I put in the commands you gave me before save as string, was that a mistake?

  4. #4
    RonaldF
    Guest

    RE: Directing a Save As in VBA

    Sorry for my first answer, the code below will do the right thing

    Sub test()

    Dim vFileName As Variant

    'Change directory and drive
    ChDrive "C"
    ChDir "C:\Data"

    'Ask for the new filename
    vFileName = Application.GetSaveAsFilename("", "Microsoft Excel-werkmap
    (*.xls),*.xls")
    If vFileName <> False Then
    Workbooks.Add.SaveAs Filename:=vFileName
    Else
    MsgBox "File hasn't been saved!!!"
    End If

    End Sub

    --
    Ronald Ferdinandus
    http://www.ro-pay.nl


    "ngarland13" wrote:

    >
    > Hi,
    >
    > I am working on a tool, and when it opens I want it to immediatly do a
    > save as (I have it read only, and can get the save as to come up, but i
    > don't want anyone saving the tool where the save as pops up, I want it
    > to co to their C/Data folder).
    >
    > The last line in my auto open vba code is below, and that brings up the
    > save as screen, but i want to direct it to go to C/Data, any help would
    > be appreciated.
    >
    > "Application.Dialogs(xlDialogSaveAs).Show"
    >
    >
    > --
    > ngarland13
    > ------------------------------------------------------------------------
    > ngarland13's Profile: http://www.excelforum.com/member.php...o&userid=23713
    > View this thread: http://www.excelforum.com/showthread...hreadid=401212
    >
    >


  5. #5
    Dave Peterson
    Guest

    Re: Directing a Save As in VBA

    ChDrive "C"
    ChDir "C:\Data"
    Application.Dialogs(xlDialogSaveAs).Show

    (if you still want to use the dialog.)



    ngarland13 wrote:
    >
    > Hi,
    >
    > I am working on a tool, and when it opens I want it to immediatly do a
    > save as (I have it read only, and can get the save as to come up, but i
    > don't want anyone saving the tool where the save as pops up, I want it
    > to co to their C/Data folder).
    >
    > The last line in my auto open vba code is below, and that brings up the
    > save as screen, but i want to direct it to go to C/Data, any help would
    > be appreciated.
    >
    > "Application.Dialogs(xlDialogSaveAs).Show"
    >
    > --
    > ngarland13
    > ------------------------------------------------------------------------
    > ngarland13's Profile: http://www.excelforum.com/member.php...o&userid=23713
    > View this thread: http://www.excelforum.com/showthread...hreadid=401212


    --

    Dave Peterson

+ 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