+ Reply to Thread
Results 1 to 10 of 10

Refreshable Data Connection from Web to Excel TABLE

  1. #1
    Registered User
    Join Date
    01-30-2015
    Location
    D/FW, Texas
    MS-Off Ver
    2013
    Posts
    18

    Refreshable Data Connection from Web to Excel TABLE

    The end goal is to have an Excel Table with a refreshable data connection to a web table.

    The reason to have an Excel Table is to use that Table as a reference point on other sheets, to perform calculations on other sheets, and to create summaries on other sheets. All of this is made much easier with the use of Table references. Also of importance is that the users wish to be able to click that 'Refresh All' button to get a current data set from the web source.

    Using 'Get External Data' 'From Web' does not result in an Excel Table. Formatting the result as a Table removes the data connection.

    How can this be achieved?

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Refreshable Data Connection from Web to Excel TABLE

    I've found the Get External Data From Web to work only in a limited set of circumstances. Can you attach a sample workbook of what it does bring down?

    To Attach a File:

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    01-30-2015
    Location
    D/FW, Texas
    MS-Off Ver
    2013
    Posts
    18

    Re: Refreshable Data Connection from Web to Excel TABLE

    I really can't upload the workbook: the website with the data is a secure site and the data is proprietary. It's not something I can share.

    I have continued to look for solutions and now I'm wondering if maybe one approach is to use one sheet (or a separate workbook) to have the link to the web data and use a another sheet (or workbook) and import the data from one to the other by way of a Microsoft Query. This approach might work but it may not be a good solution.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Refreshable Data Connection from Web to Excel TABLE

    Can you change names or whatever so as to desensitize the data? I just need to see what the format of the data looks like. If you can fill it in with dummy values, it should be enough to suggest a solution.

  5. #5
    Registered User
    Join Date
    01-30-2015
    Location
    D/FW, Texas
    MS-Off Ver
    2013
    Posts
    18

    Re: Refreshable Data Connection from Web to Excel TABLE

    This is an attempt to submit an Excel workbook file.

    If this succeeds, the attached workbook is an example only and not the actual file on which I'm working.

    This sample has a live data connection to online data. The nature of the connection is similar to the connection used in the actual workbook.

    Viewing the data in the workbook, one can see it is not in a table format. I would like to have the results formatted as an Excel Table while keeping the connection to the data source so that the data can be refreshed on demand.
    Attached Files Attached Files

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Refreshable Data Connection from Web to Excel TABLE

    There are two ways to do this:
    1. Attempt to make a table out of the range
    2. Cheat: copy the range contents into a pre-existing table.

    My adage is "If you can't play and cheat, don't play." So I opted for way 2.

    Set the table page up with the same column headers that you will be importing. The program will figure out how many rows and columns you are importing.

    I commented the code where you may want to change it in case you have different sheet names or table name. Also, in determining the last row, in the example the last row is a comment and I will assume you don't want it. So there is a piece of code that looks like:
    ' LRowS = LRowS -1
    If you take away the single quote, this becomes a command instead of a comment, and you will not copy the last row.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-30-2015
    Location
    D/FW, Texas
    MS-Off Ver
    2013
    Posts
    18

    Re: Refreshable Data Connection from Web to Excel TABLE

    A couple of concerns:
    If after refreshing the data there are fewer records than previously, the Table won't be shortened to only the current set of records but will continue to have old records at the bottom of the table.

    Second, the ClearTable generates an undefined sub or function error.

  8. #8
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Refreshable Data Connection from Web to Excel TABLE

    The second issue is related to the first. The ClearTable subroutine removes all data from the table, leaving only the headers and the "format" (formats, formulas, etc.). So copying the new data in, even if it has fewer rows than what was there, won't be an issue.

    As for the error: I can't duplicate it. Can you include the line of code that is highlighted in the debugger?

  9. #9
    Registered User
    Join Date
    01-30-2015
    Location
    D/FW, Texas
    MS-Off Ver
    2013
    Posts
    18

    Re: Refreshable Data Connection from Web to Excel TABLE

    Quote Originally Posted by dflak View Post
    The second issue is related to the first. The ClearTable subroutine removes all data from the table, leaving only the headers and the "format" (formats, formulas, etc.). So copying the new data in, even if it has fewer rows than what was there, won't be an issue.

    As for the error: I can't duplicate it. Can you include the line of code that is highlighted in the debugger?
    Compile Error: Sub or Function not defined

  10. #10
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Refreshable Data Connection from Web to Excel TABLE

    I need to see the actual line that is highlighted. I've been using this code for several years now and have included it in many of my solutions. I've never seen that particular error. I'd need to drill down to see what it might be getting indigestion over. I'm running this code on 2013 as well.

+ 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. Change pivot table data connection if current connection = x
    By BellyGas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-13-2016, 06:05 AM
  2. Replies: 1
    Last Post: 03-29-2016, 04:29 PM
  3. Excel services publication of refreshable table
    By shaman171 in forum Excel General
    Replies: 0
    Last Post: 07-21-2015, 06:02 PM
  4. Replies: 2
    Last Post: 05-15-2015, 04:12 PM
  5. Excel Data Table Connection...
    By isierra in forum Excel General
    Replies: 0
    Last Post: 07-02-2012, 01:46 PM
  6. Average of Pivot Table values (refreshable)
    By JuJuBe in forum Excel General
    Replies: 7
    Last Post: 07-19-2010, 09:46 PM
  7. Excel 2007 data connection not using connection file
    By algilstrap in forum Excel General
    Replies: 0
    Last Post: 06-09-2009, 03:01 PM

Tags for this Thread

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