Connect Local Excel file with Gsheet ( GDrive File )

 


🧭 Step-by-Step Guide

🧩 Step 1: Get a “Direct Download” Link from Google Drive

Let’s say your file is in Drive like this:

https://drive.google.com/file/d/1ABCxyzPQRSTuv/view?usp=sharing

You need to convert it to a direct export link:

✅ For a .csv or .xlsx file:

Replace the part:

/file/d/FILE_ID/view?usp=sharing

with:

/uc?export=download&id=FILE_ID

👉 Example:

https://drive.google.com/uc?export=download&id=1ABCxyzPQRSTuv

That’s the URL you’ll use in Power Query.


🧩 Step 2: Open Power Query in Excel

  1. Open Excel.

  2. Go to the Data tab.

  3. Click Get Data → From Other Sources → From Web.


🧩 Step 3: Paste the Google Drive Link

  • Paste your converted link, e.g.

    https://drive.google.com/uc?export=download&id=1ABCxyzPQRSTuv
  • Click OK.


🧩 Step 4: Load or Transform Data

  • Excel will connect and show a preview.

  • If it’s a CSV: you’ll see table data right away.
    Click Load (or Transform Data to clean it first).

  • If it’s an XLSX: Power Query might ask for the sheet/table name first — select it.


🧩 Step 5: Refresh Anytime

Once loaded:

  • Go to Data → Refresh All
    to pull the latest version from Google Drive (if the Drive file was replaced or updated).


🧠 Optional: Automate the Refresh

You can set Excel to auto-refresh on file open:

  1. Go to Data → Queries & Connections.

  2. Right-click your query → Properties.

  3. Check ✅ “Refresh data when opening the file”.


⚠️ Important Notes

TypeWorks withNotes
.csv✅ PerfectLoads cleanly and quickly
.xlsx⚠️ SometimesGoogle Drive doesn’t stream XLSX perfectly; better to export via Google Sheets
Google Sheet✅ Using export linkUse special link format (below)

🔗 Bonus: If the file is a Google Sheet

If your data is stored in a Google Sheet, use this format instead:

https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/export?format=csv&id=SPREADSHEET_ID&gid=SHEET_GID

You can get gid from the URL of the sheet tab:

https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit#gid=123456789

Then use the link:

https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/export?format=csv&gid=123456789

Paste that into Power Query “From Web”.



Reference Video :


Post a Comment

Previous Next

نموذج الاتصال