Expression Error

excelbytes

Active Member
Joined
Dec 11, 2014
Messages
296
Office Version
  1. 365
Platform
  1. Windows
I created VBA code whereby when the user receives a file, it adds a new worksheet, transfers data to that worksheet and creates a table, then saves that file to a specific folder. I have another file that has Power Query steps that will pull the data from all the tables in that folder into one table. Then as new files are added into that folder, I refresh the Power Query table steps and it adds the new file's data to that table. It used to work fine. However, now I get the following error:

[Expression error] The key didn't match any rows in the table

I've confirmed all the new files have the correct worksheet name and table name, and all the headers in the table match. Any suggestions as to what the "key" is referencing?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hello! Go through the steps in the Power Query editor. Did you change the file extension?
 
Upvote 0
Hello! Go through the steps in the Power Query editor. Did you change the file extension?
No, I didn't change the file extension. However, when looking at the Power Query editor, I see the last file I tried to include just shows "Error" across all the columns. When I click on Error, at the bottom in yellow appears the following:

An error occurred in the ‘Transform File’ query. Expression.Error: The key didn't match any rows in the table.
Details:
Key=
Item=PartsFormTable
Kind=Sheet
Table=


PartFormTable is the name of the worksheet that is created and where the new table, called "PartsForm" is created. I'm not sure that Table=
means.
 
Upvote 0
The name of the sheet or the name of the table did not change?
 
Upvote 0
I think I found the issue. There was one file in that folder that didn't belong. I removed it and the process works. Thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,226,502
Messages
6,191,400
Members
453,655
Latest member
lasvegasbuffet

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