Getting data from a "published" Google Sheet?

jimrowland

New Member
Joined
Jul 14, 2013
Messages
12
I have a published google sheet located here: https://docs.google.com/spreadsheet...iWOaXWxnzD39LdApRsA/pubhtml?gid=0&single=true


I would like to import that into my current Excel 2007 work book, into the sheet "Dispatch", and into columns DB:DG, starting at Row 3 and going down as far as necessary. This external data changes semi-frequently (every few days), so I would like to replace the old data in the "Dispatch" sheet with the new data.

I copied and pasted (and tweaked) an example from this site: Extracting a table of data from a website using a VBA query
But nothing seems to happen.

This new Sub runs just fine (completes without errors), and deletes all of the old data, but I'm left with nothing being imported.


Here is the final code I came up with:
Sub GetPlanes()

'=====Clear current Data=====
Worksheets("Dispatch").Range("DA:DG").ClearContents


Dim qt As QueryTable
Dim ws As Worksheet


Set ws = Worksheets("Dispatch")


'set up a table import (the URL; tells Excel that this query comes from a website)
Set qt = ws.QueryTables.Add( _
Connection:="URL;" & "https://docs.google.com/spreadsheets/d/15zrfM0q3UFUsLCwfIbLD2WcGiWOaXWxnzD39LdApRsA/pubhtml?gid=0&single=true", _
Destination:=Range("DB3"))


qt.RefreshOnFileOpen = True




End Sub



I also scrolled through this page (which I found after searching MrExcel for my issue), but it's a bit more advanced than the hand-holding I apparently need.
http://www.mcpher.com/Home/excelquirks/get-data-from-google-docs



Appreciate any thoughts on this.

Jim
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top