Power Query Source Links Errors how to fix?

daleholden

Board Regular
Joined
Sep 22, 2002
Messages
243
HI Guys

I have several Excel workbooks stored in OneDrive which I access in my home via Desktop or Laptop. I have noticed when I open my files on my laptop all my power query error as the link to the folder is based on my Desktop.I would have thought using Onedrive to store all my files it would work on any machine. What am I doing wrong I am not trying to share with other just myself.
I have seen several very convoluted ways to share with other team members. But mine is not that just myself using the same OneDrive account.

Dale
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
This is my current code and getting a token error on Source see here

Where are you putting this code?




let


LaptopPath = "D:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices",
Desktop1Path = "G:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices",
Desktop2Path = "C:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices",




LaptopTest = try List.Count(Folder.Files(LaptopPath)[Content]),
Desktop1Test = try List.Count(Folder.Files(Desktop1Path)[Content]),
Desktop2Test = try List.Count(Folder.Files(Desktop2Path)[Content]),




Source = if LaptopTest[HasError] then
if Desktop1Test[HasError] then
if Desktop2Test[HasError] then
"Cannot find Data Source"
else
Folder.Files(Desktop2Path)
else
Folder.Files(Desktop1Path)
else
Folder.Files(LaptopPath)












Source = Folder.Files("G:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices"),
#"Combined Binaries" = Binary.Combine(Source[Content]),
#"Imported CSV" = Csv.Document(#"Combined Binaries",[Delimiter=",", Columns=8, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Changed Type" = Table.TransformColumnTypes(#"Imported CSV",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}}),
#"Removed Top Rows" = Table.Skip(#"Changed Type",7),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows"),
#"Filtered Rows" = Table.SelectRows(#"Promoted Headers", each ([Fee type] <> "" and [Fee type] <> "Fee type" and [Fee type] <> "N/A")),
#"Split Column by Delimiter" = Table.SplitColumn(#"Filtered Rows","Date",Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false),{"Date.1", "Date.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Date.1", type date}, {"Date.2", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Date.2", "VIN/Serial number"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Removed Columns",{{"Date.1", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type2",{{"Date.1", "Date"}, {"Item", "eBay Listing Number"}}),
#"Changed Type3" = Table.TransformColumnTypes(#"Renamed Columns",{{"Amount", Currency.Type}, {"Promotional savings", Currency.Type}}),
#"Filtered Rows1" = Table.SelectRows(#"Changed Type3", each ([Amount] <> null)),
#"Removed Columns1" = Table.RemoveColumns(#"Filtered Rows1",{"Promotional savings", "ReceivedTopRatedDiscount"})
in
#"Removed Columns1"
 
Upvote 0
Also, I've just tested connecting directly to OneDrive using the link I mentioned and it does work.
 
Upvote 0
I have done a copy paste and i get token error?#

If i run compare against mine and yours it is identical!!!

So not sure what you mean the if is broken???

let
LaptopPath = "D:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices",
Desktop1Path = "G:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices",
Desktop2Path = "C:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices",




LaptopTest = try List.Count(Folder.Files(LaptopPath)[Content]),
Desktop1Test = try List.Count(Folder.Files(Desktop1Path)[Content]),
Desktop2Test = try List.Count(Folder.Files(Desktop2Path)[Content]),




Source = if LaptopTest[HasError] then
if Desktop1Test[HasError] then
if Desktop2Test[HasError] then
"Cannot find Data Source"
else
Folder.Files(Desktop2Path)
else
Folder.Files(Desktop1Path)
else
Folder.Files(LaptopPath)
Source = Folder.Files("G:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices"),
#"Combined Binaries" = Binary.Combine(Source[Content]),
#"Imported CSV" = Csv.Document(#"Combined Binaries",[Delimiter=",", Columns=8, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Changed Type" = Table.TransformColumnTypes(#"Imported CSV",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}}),
#"Removed Top Rows" = Table.Skip(#"Changed Type",7),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows"),
#"Filtered Rows" = Table.SelectRows(#"Promoted Headers", each ([Fee type] <> "" and [Fee type] <> "Fee type" and [Fee type] <> "N/A")),
#"Split Column by Delimiter" = Table.SplitColumn(#"Filtered Rows","Date",Splitter.SplitTextByEachDelimiter({" "}, QuoteStyle.Csv, false),{"Date.1", "Date.2"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Date.1", type date}, {"Date.2", type text}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Date.2", "VIN/Serial number"}),
#"Changed Type2" = Table.TransformColumnTypes(#"Removed Columns",{{"Date.1", type date}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type2",{{"Date.1", "Date"}, {"Item", "eBay Listing Number"}}),
#"Changed Type3" = Table.TransformColumnTypes(#"Renamed Columns",{{"Amount", Currency.Type}, {"Promotional savings", Currency.Type}}),
#"Filtered Rows1" = Table.SelectRows(#"Changed Type3", each ([Amount] <> null)),
#"Removed Columns1" = Table.RemoveColumns(#"Filtered Rows1",{"Promotional savings", "ReceivedTopRatedDiscount"})
in
#"Removed Columns1"
 
Upvote 0
You now need to delete the following line:

Source = Folder.Files("G:\OneDrive\Documents\Excel Files\Anditsgone Excell and CSV Files\CSV Files\eBay Invoices"),
 
Last edited:
Upvote 0

Forum statistics

Threads
1,225,726
Messages
6,186,674
Members
453,368
Latest member
xxtanka

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