+ Reply to Thread
Results 1 to 3 of 3

Reading information from a closed workbook

  1. #1
    Registered User
    Join Date
    03-15-2006
    Posts
    1

    Reading information from a closed workbook

    Hi

    I need to run a VBA program that reads information from a second excel workbook.

    Is it possible to extract this information while the second workbook is closed?

    Thanks

  2. #2
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    you'll find the excel tips a wonderful source of information.

  3. #3
    Tom Ogilvy
    Guest

    RE: Reading information from a closed workbook

    the best answer would depend a lot on the specifics. However, the fastest
    way is to put a linking formula in a worksheet and retrieve the information

    ActiveCell.Formula = "='C:\My Folder\[Myfile.xls]Sheet1'!A1"
    ' No replace the formula with the value returned
    ActiveCell.Formula = ActiveCell.Value

    you can do multiple cells this way with one command

    with ActiveCell.Resize(50,10)
    .Formula = "='C:\My Folder\[Myfile.xls]Sheet1'!A1"
    .Formula = .Value
    End with

    If the data is organized like a Database, you can use ADO


    http://www.erlandsendata.no/english/...php?t=envbadac

    --
    Regards,
    Tom Ogilvy



    "yhockman1" wrote:

    >
    > Hi
    >
    > I need to run a VBA program that reads information from a second excel
    > workbook.
    >
    > Is it possible to extract this information while the second workbook is
    > closed?
    >
    > Thanks
    >
    >
    > --
    > yhockman1
    > ------------------------------------------------------------------------
    > yhockman1's Profile: http://www.excelforum.com/member.php...o&userid=32474
    > View this thread: http://www.excelforum.com/showthread...hreadid=522603
    >
    >


+ 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