PowerQuery | Load files based on cell reference

rachel06

Board Regular
Joined
Feb 3, 2016
Messages
193
Office Version
  1. 365
Platform
  1. Windows
Hi!

I've got a query almost all worked out.

I'm trying to replace the "Source=Folder" to reference a cell (in my case Cell C3 that I have named "FilePath") rather than a specific file path but I'm getting an error.

This is what I found on another thread, but it's not working for me. Please note that these two lines are replacing one that looks like this:

Source = Folder.Files("C:\Users\MyFiles\Desktop\MyClient\Feb Reports")

The error I'm getting is

Expression.Error: We cannot convert the value null to type Text.

Details
Value =
Type=[Type]

Code:
let
    FilePath = Excel.CurrentWorkbook(){[Name="FilePath"]}[Content]{0}[Column1],
    Source = Excel.Workbook(File.Contents(FilePath), null, true),

Looks like the rest of the code is just the columns I deleted or edited so I don't think that's important for this, but any help on how to resolve would be much appreciated!!
 
It's 32 bit and yeah, just trying to load to the data model for transformation
 
Upvote 0
I'd upgrade to 64 bit if you can then.
 
Upvote 0

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