+ Reply to Thread
Results 1 to 18 of 18

Read data from closed workbook

  1. #1
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Read data from closed workbook

    I have a pricelist that another workbook is referring to. But each time I open the workbook I need to open the price list to get it updated. I don't want that, as other users would not understand this.

    After googling around I understand that I can do something with VBA so that it can be read when opened without being opened?

    One that I tried was this, but it does not seem to work. Also I want to read the whole workbook not only rows/columns/sheets. Is there an easier way?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    Try
    Please Login or Register  to view this content.
    Last edited by jindon; 02-22-2021 at 07:59 AM.

  3. #3
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    Thanks but that didn't work either.

    looking at the link the status says "Error: worksheet not found".

    I'm new with VBA. But does that code search the whole worknook or only sheet 1? The workbook has several sheets.

    Thanks

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    I just coded based on your code
    Please Login or Register  to view this content.
    by the way, I just realized the col reference "B", so I edited the code.

  5. #5
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    Ok. How can it be coded to read the whole workbook not only sheets?

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    What are you really trying to do then?

  7. #7
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    I have a workbook that is linked to another workbook picking up data. And when I open the working sheet I always need to open the linked workbook to get it working. I was hoping to not needing to open that data workbook each time, just have it automatically look for the file and read the whole workbook.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    What do you mean by "whole workbook"?

    Can you just explain step by step when you do it manually.

  9. #9
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    Ok So I have 2 workbooks. Pricelist and Builder. Builder looks into Pricelist for data to calculate.

    So I open Builder and the first thing I'm met with is an error:
    Please Login or Register  to view this content.
    So I press Continue and nothing works due to links not working.

    So if I go to "edit links" it shows the price list but status is unknown, trying to check the status I get error that its not found. If I however open source I open the price list. Now that its open I can use the builder as intended.

    I just dont want that error to show when using builder, and I dont want to open the source file each time. I only want to open the builder and have it working.

    Is that possible?

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    In that case, when you open the Builder with the error message, open Pricelist.
    If the link works, close Pricelist and the formula should automatically updates the full path.

    Does that help?

  11. #11
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    Yes that works. But I dont want to open pricelist each time, as other users would not understand this.

    Is there any way to avoid this with VBA?

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    After the link is automatically updated, you don't need to open the other workbook.
    Make sure the link is now full path.

  13. #13
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    It is. But once I open it up on another PC I need to open the pricelist to have it synced again. I dont want that.

  14. #14
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    That means the path is changing, there's no way to update the link with unknown path.

  15. #15
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    No the path is the same. We share dropbox and have dropbox on C: on all PCs. So path is always the same. I just need to find a VBA code for it to use instead.

  16. #16
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    Then show us the current formula in the cell with the link that is throwing the error and the the full path of the Pricelist.

  17. #17
    Registered User
    Join Date
    06-18-2020
    Location
    Norway
    MS-Off Ver
    365
    Posts
    26

    Re: Read data from closed workbook

    Here is one:
    Please Login or Register  to view this content.
    And under Data - Edit Links it shows the patch to the correct place. But each time I have to open the pricelist workbook to get the builder working. I just dont want to open the price list each time I want to use the builder workbook.

  18. #18
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Read data from closed workbook

    I don't think you can link to the "Table" in closed workbook.
    So, better use range...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA. Read and write data into and from a closed workbook
    By EMat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2020, 04:00 PM
  2. Replies: 0
    Last Post: 03-27-2014, 12:38 PM
  3. Read a range from a closed workbook
    By danny2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2010, 06:07 AM
  4. Open and read closed workbook
    By Phrone in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2009, 03:55 PM
  5. How to Read/Write Data to/from a closed workbook
    By samtwilliams in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-11-2008, 10:02 AM
  6. [SOLVED] Read/Write from/to a closed workbook
    By Alan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2006, 09:00 AM
  7. [SOLVED] How to read from a closed workbook?
    By matelot in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-05-2005, 02:45 AM

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