Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Jun 2008
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Accessing WB w/out Open (O2000SR1)

    Is it possible to read the data in a workbook using VBA without opening it? If so, is there an xldialog like the xldialogopen that would allow my user to choose which file to deal with without opening that file? I presume that I would set my workbook variable = "path/filename.xls" once I knew that: would that work?

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accessing WB w/out Open (O2000SR1)

    No way that I know of. If you turn screen updating off while opening it, you can keep the user from seeing that you opened it. You can also hide the workbook after opening. What are you trying to accomplish?
    Legare Coleman

  3. #3
    New Lounger
    Join Date
    Jun 2008
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accessing WB w/out Open (O2000SR1)

    I develop apps for clients. Those apps get enhanced over time. I've built in an "import" macro that allows a client to import an old version into a newer one, eliminating the pain of reentering all the data. The only problem I have right now is that the app normally opens with a form, and now when I am doing an import, it opens the old workbook, triggering that unwanted form. The reason I thought it might be possible to access the data without opening is that excel itself seems to do this with its links and so on.

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Accessing WB w/out Open (O2000SR1)

    See my response to your other post.
    Legare Coleman

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Accessing WB w/out Open (O2000SR1)

    Legare,

    Just catching up on the Excel Lounge.

    I believe there is a way to read data w/o opening a workbook. I believe I did this for a client with XLM macros. Of course, it's at home. But I believe I got the method from one of John Walkenbach's books.

    Fred

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Accessing WB w/out Open (O2000SR1)

    Take a look at <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=vb&Number=101449&page=0&vie w=expanded&sb=5&o=0&fpart=>This thread</A> in the VBA forum, as it may get you started.

    Andrew C

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Accessing WB w/out Open (O2000SR1)

    Hi Andrew,

    The thread you referenced had several posts. The first one, in fact, referenced John's tip that I had used earlier this year for my client. Then your post, the last one in that thread, adopted John's tip also (with the ExecuteExcel4Macro).

    In the current thread, I was responding to Legare who said "No way that I know of" in response to wivers' post. But it wasn't clear which question from wivers' first post Legare was answering:
    - possible to read from a closed file
    - some xldialog to allow the user to choose a file
    But wivers' 2nd post seemed to suggest his greatest need was for the first item. I would think you could always develop a form to address the 2nd item. So I was simply suggesting to Legare that there was a way to read data from a closed file, as seems to be well-known by now.

    But note that I was NOT in need of a method to read from a closed workbook -- given my efforts earlier in the year. Thanks for thinking of me, tho. Hopefully wivers has gotten at least this much of an answer.

    Fred

Posting Permissions

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