+ Reply to Thread
Results 1 to 6 of 6

Open new workbook

  1. #1
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    Open new workbook

    i am looking for some vb code to open an existing workbook in a new workbook.

    i have been using the following code

    workbook.open "C:\flder1\folder\excel.xls"

    but i would like to create a link on a VB form to open a new work book whilst keeping the form open. cannot seem to do this but thought it might work if i could get it to open it in a whole new bookseparate to the one with the form.

    the reason for this is i want to create a shortcut to the workbook the user will pul information from the complete the form.

  2. #2
    Tom Ogilvy
    Guest

    Re: Open new workbook

    Dim bk as Workbook
    set bk = workbook.open( "C:\flder1\folder\excel.xls")

    Not sure what you mean by link. But that creates a reference to the
    workbooks which you can use to refer to it.

    --
    Regards,
    Tom Ogilvy


    "ceemo" <[email protected]> wrote in
    message news:[email protected]...
    >
    > i am looking for some vb code to open an existing workbook in a new
    > workbook.
    >
    > i have been using the following code
    >
    > workbook.open "C:\flder1\folder\excel.xls"
    >
    > but i would like to create a link on a VB form to open a new work book
    > whilst keeping the form open. cannot seem to do this but thought it
    > might work if i could get it to open it in a whole new bookseparate to
    > the one with the form.
    >
    > the reason for this is i want to create a shortcut to the workbook the
    > user will pul information from the complete the form.
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile:

    http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=390164
    >




  3. #3
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    hmm

    would that notopen the spreadsheet in the existing work book?

  4. #4
    Tom Ogilvy
    Guest

    Re: Open new workbook

    No. That opens the workbook in the same instance of Excel, but they are
    still separate workbooks.

    --
    Regards,
    Tom Ogilvy


    "ceemo" <[email protected]> wrote in
    message news:[email protected]...
    >
    > would that notopen the spreadsheet in the existing work book?
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile:

    http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=390164
    >




  5. #5
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    separate instance

    is there a way to open it in a searate instance?

  6. #6
    Tom Ogilvy
    Guest

    Re: Open new workbook

    sure, but I don't see the point. That would just make it extremely
    difficult to work with. Based on what you say you are doing, this seems
    like the wrong way to go.

    but your choice:

    Automating excel from excel is no different from automating it from any
    other Office product or from VB.

    http://support.microsoft.com/support...aqVBOffice.asp
    Frequently Asked Questions about Microsoft Office Automation Using Visual
    Basic


    http://support.microsoft.com/support...fdevinapps.asp
    Programming Office from Within Office

    http://support.microsoft.com/support...dev/iisfaq.asp
    Integrating Office with IIS FAQ

    http://support.microsoft.com/?id=219151
    Q219151 - HOWTO: Automate Excel 97 and Excel 2000 from Visual Basic

    http://support.microsoft.com/support...automation.asp
    Using Automation with Microsoft Excel 97

    http://support.microsoft.com/?id=170745
    XL97: How to Create PivotTable from Word

    http://support.microsoft.com/?id=177760
    VBA: How to Run Macros in Other Office Programs

    http://support.microsoft.com/?id=153748
    ACC: How to Call Excel Functions from Within Microsoft Access

    http://support.microsoft.com/?id=167223
    Microsoft Office 97 Automation Help File Available on MSL

    http://support.microsoft.com/?id=159922
    XL97: Using Quit Method May Cause Illegal Operation

    http://support.microsoft.com/?id=145770
    ACC: Automation Does Not Close Microsoft Excel

    http://support.microsoft.com/?id=123859
    ACC: Sample OLE Automation for MS Word and MS Excel

    http://support.microsoft.com/?id=142476
    Q142476 - ACC: Using Automation to Create and Manipulate an Excel Workbook

    http://support.microsoft.com/?id=199219
    XL2000: Automation Doesn't Release Excel Object from Memory

    http://support.microsoft.com/?id=213602
    XL2000: CreateObject and GetObject Work Differently

    http://support.microsoft.com/?id=114347
    INFO: OLE Automation Objects with GetObject and CreateObject

    http://support.microsoft.com/?id=184273
    ACC97: How to Use Automation to Create a Microsoft Excel Chart


    http://support.microsoft.com/kbid?129304
    ACC: Using Automation to Transfer Data to Microsoft Excel

    http://support.microsoft.com/support...151/introd.asp
    Office for Windows An Introduction to OLE Automation

    http://support.microsoft.com/?id=234774
    HOWTO: Automate Excel from an HTML Web Page Using JScript

    http://support.microsoft.com/?id=198703
    HOWTO: Automating Excel From Client-Side VBScript

    --
    Regards,
    Tom Ogilvy



    "ceemo" <[email protected]> wrote in
    message news:[email protected]...
    >
    > is there a way to open it in a searate instance?
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile:

    http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=390164
    >




+ 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