+ Reply to Thread
Results 1 to 3 of 3

Populating Excel with JSON data from links in cells

  1. #1
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2003
    Posts
    3

    Populating Excel with JSON data from links in cells

    I've read dozens of examples and tried them all, can't seem to get anything working for me, so be gentle, I'm new to excel programming.
    If it makes a difference, I am doing this on Excel 2011 (MAC) because the people wanting it all use macs and that may be the issue, it seems the OSX version of Excel is gimped in the vba dept.
    Basically I have a sheet of URLs in column A
    I have an API call I can make to those URLs that returns stats about that url in JSON.
    How do I (in detail, i've never done this) make a function that will take the URL in ColumnA, append it to the end of the API link, do the GET on that, extract the JSON response and put that in ColumnB

    The API link is formatted like this:
    https://api-ssl.bitly.com/v3/link/clicks?access_token=PrivateToken&link=LinkfromColumnA
    (I removed my oauth token and replaced with "PrivateToken")

    That link returns JSON like this:
    {"status_code": 200, "data": {"units": -1, "unit_reference_ts": null, "tz_offset": -4, "unit": "day", "link_clicks": 707}, "status_txt": "OK"}

    All I need is the link_clicks

    I made this function based off of days of reading and trying to understand.:
    Please Login or Register  to view this content.
    How do I call it from Excel?
    How do I pass the ColumnA data to the variable URL in the function?
    Can I just fill down once I get the first one and it will do all the other links in the column?
    I appreciate any help

  2. #2
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Populating Excel with JSON data from links in cells

    If I try to call that function (or any function/sub with a createObject) i get an error:
    Run-time error '429':
    ActiveX component can't create object

  3. #3
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Populating Excel with JSON data from links in cells

    While I would still like to know the issue as to why it won't work in excel, it took me all of 10 min to code the function in Google Docs and make it work like a champ.
    Over 24hrs of banging my head to get nowhere in Excel and 10min in another IDE...

+ 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. Json file from URL to Excel
    By KK33317 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-21-2014, 10:50 AM
  2. Json file from URL to Excel
    By KK33317 in forum Tips and Tutorials
    Replies: 0
    Last Post: 03-13-2014, 07:39 AM
  3. [SOLVED] Pulling json or csv data from a url
    By Versial in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-10-2012, 04:43 AM
  4. Importing JSON Data into Excel
    By Kyle123 in forum Excel Tips
    Replies: 1
    Last Post: 07-25-2012, 08:47 AM
  5. populating excel cells with data from data sources
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2005, 08:50 PM

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