+ Reply to Thread
Results 1 to 5 of 5

Saving workbook from VB

  1. #1
    Old Car
    Guest

    Saving workbook from VB

    How can I effectively do a "save" or "save as" of a workbood from VB. I
    assume there are methods that support this. Thanks.



  2. #2
    zackb
    Guest

    Re: Saving workbook from VB

    Hi,

    Do you mean, VBA? Visual Basic is NOT the same as Visual Basic for
    Applications. VB <> VBA. If you are talking the programming language in
    which Excel has and is able to utilize, you're talking VBA. VB is a stand
    alone program which is a little more versatile than VBA. A google search
    will yield many results.

    But if you are asking about VBA, then try the following ...

    Sub testingSave()
    Thisworkbook.Save
    End sub

    or..

    Sub testingSaveAs()
    Thisworkbook.SaveAs "C:\MyWorkbook.xls"
    End sub

    Is this what you're talking about?

    --
    Regards,
    Zack Barresse, aka firefytr


    "Old Car" <nospam@nospam.com> wrote in message
    news:uEwce.90$r81.40@trnddc02...
    > How can I effectively do a "save" or "save as" of a workbood from VB. I
    > assume there are methods that support this. Thanks.
    >
    >




  3. #3
    Jim Thomlinson
    Guest

    RE: Saving workbook from VB

    All of these are possible solutions... Depends exactly what you want...

    ThisWorkbook.Save
    ThisWorkbook.SaveAs "C:\Test.xls"
    ThisWorkbook.SaveCopyAs "C:\test.xls"
    Application.Dialogs(xlDialogSaveAs).Show "C:\Test.xls"
    Application.Dialogs(xlDialogSaveCopyAs).Show "C:\Test.xls"

    HTH

    Thisworkbook.

    "Old Car" wrote:

    > How can I effectively do a "save" or "save as" of a workbood from VB. I
    > assume there are methods that support this. Thanks.
    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Saving workbook from VB

    Assuming you mean VBA, Save and SaveAs are detailed in help.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Old Car" <nospam@nospam.com> wrote in message
    news:uEwce.90$r81.40@trnddc02...
    > How can I effectively do a "save" or "save as" of a workbood from VB. I
    > assume there are methods that support this. Thanks.
    >
    >




  5. #5
    Old Car
    Guest

    Re: Saving workbook from VB

    Application.Dialogs(xlDialogSaveCopyAs).Show "C:\Test.xls"

    gives me a run-time error.

    Run-time error '1004':
    Application-defined or object-defined error.

    Does you know why? Thanks.

    "Jim Thomlinson" <JimThomlinson@discussions.microsoft.com> wrote in message
    news:C35BDD71-BBF4-43A0-B905-7E84C5819C4E@microsoft.com...
    > All of these are possible solutions... Depends exactly what you want...
    >
    > ThisWorkbook.Save
    > ThisWorkbook.SaveAs "C:\Test.xls"
    > ThisWorkbook.SaveCopyAs "C:\test.xls"
    > Application.Dialogs(xlDialogSaveAs).Show "C:\Test.xls"
    > Application.Dialogs(xlDialogSaveCopyAs).Show "C:\Test.xls"
    >
    > HTH
    >
    > Thisworkbook.
    >
    > "Old Car" wrote:
    >
    > > How can I effectively do a "save" or "save as" of a workbood from VB. I
    > > assume there are methods that support this. Thanks.
    > >
    > >
    > >




+ 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