title: How to import data from Google Sheets into Excel with VBA
body: <p>I am trying to import data from Google Sheets into Excel but I think the problem is with the security settings in my computer.</p>
  
  <p>Already tried to create a new query > from other sources > from web and changing the shared link with <a href="https://docs.google.com/spreadsheets/d/export?format=xlsx" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/export?format=xlsx</a> but it's not showing me any information</p>
  
  <p>Also tried to run a macro but it's not retrieving me any information</p>
  
  <pre><code>Sub Import_Data()
   Dim conn As String
   conn = "URL;https://docs.google.com/spreadsheets/d/edit#gid=0"
   With 
       ActiveSheet.QueryTables.Add(Connection:=conn, Destination:=Range("$A$1"))
      .WebTables = "1,2"
      .Refresh True
   End With
  End Sub
  </code></pre>
  
  <p>I want to have all the information coming into this Google Sheet connected to an Excel sheet to auto populate where I can work with this data more easily without copy pasting it into Excel. About the security settings, I cannot log in into a google account directly, my company computer is set to log into everything you need inside with the Windows ID and password. I also tried to edit the Data Source Settings in the Edit Permissions window for <a href="https://docs.google.com/spreadsheets" rel="nofollow noreferrer">https://docs.google.com/spreadsheets</a> using my windows credentials, but I had no luck. Any ideas on a workaround?</p>