PQ Issue: Cannot Convert type Table to Type Binary

Pulsar3000

New Member
Joined
Apr 19, 2021
Messages
44
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone:

I have a power query with a dynamic file path to get a set of files from one folder. The files only have one sheet but the sheets have different names.
I'm trying to make my file path to work but get the error: We cannot convert a value of type Table to type Binary.

Here's the majority of the M code for "Other Queries" and note that the FolderPath in the first line is a named range for one cell only that contains a link.

1709357962631.png


Here's the M code for the Sample File. The item in orange is not literal. My real M code has the entire actual path of where the folder is located but didn't want to provide it for privacy reasons.

let
Source = Folder.Files("ACTUAL FILE PATH"),
Content0 = Source{0}[Content]
in
Content0

Can someone help me troubleshoot? Thanks in advance for your help!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi,
In the second step you have the function Excel.Workbook. that function takes a binary (file) as input, but the output is a table.
However you have nested Folder.Files, which returns a table.
1709391684102.png


You probably have in this table a list of Binary files on which you want to invoke a function to get to the content of the binaries through Excel.Workbook.
It's likely you already have that in the Invoke Custom Function step.

Try leaving your source step as Folder.Files(Path).
 
Upvote 1
Solution
Hi,
In the second step you have the function Excel.Workbook. that function takes a binary (file) as input, but the output is a table.
However you have nested Folder.Files, which returns a table.
View attachment 107780

You probably have in this table a list of Binary files on which you want to invoke a function to get to the content of the binaries through Excel.Workbook.
It's likely you already have that in the Invoke Custom Function step.

Try leaving your source step as Folder.Files(Path).
Thank you so much!! That worked.
 
Upvote 0
Thank you for the feedback. Glad to help.
 
Upvote 0

Forum statistics

Threads
1,215,080
Messages
6,123,013
Members
449,093
Latest member
ikke

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