FN Get Contents error

Craigc3814

Board Regular
Joined
Mar 7, 2016
Messages
217
I have been compiling excel files from a network folder for a few months now, for whatever reason this months file will not work. I am getting an error on the Get Contents formula found on Ken Puls site. It is pulling all other files in, but generates an error on this months. The only thing I knew to check was to make sure the sheet name or column headings had not changed. Found an issue with the sheet name and that atleast brings the data in but every single line now generates an error.

Has anyone had anything similar? I dont really even know what I am looking for. Below is the code. The file name is slightly different than 6 of the other files they had sent but there is one other with a completely different file name that works fine.



let
Source = Folder.Files("W:\DATA\Operations\Procurement\Utility Locating Services\811 Invoices"),
#"Added Custom" = Table.AddColumn(Source, "Custom", each fnGetContents([Folder Path]&[Name])),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"request_no", "CDC", "type", "county", "township", "contractor", "address", "sortfullname", "workcode_id", "cost", "util_id", "transmit_date", "transmit_time", "dateofwork", "starttime", "endtime", "sba_desc", "workfor", "Caller", "WorkType", "DueDate", "PYPN_flag", "invoice_no", "dateofinv", "district", "Sales_Tax_City", "Sales_Tax_State"}, {"request_no", "CDC", "type", "county", "township", "contractor", "address", "sortfullname", "workcode_id", "cost", "util_id", "transmit_date", "transmit_time", "dateofwork", "starttime", "endtime", "sba_desc", "workfor", "Caller", "WorkType", "DueDate", "PYPN_flag", "invoice_no", "dateofinv", "district", "Sales_Tax_City", "Sales_Tax_State"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Custom",{{"transmit_date", type date}, {"dateofwork", type date}, {"DueDate", type date}, {"dateofinv", type date}, {"starttime", type time}, {"endtime", type time}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type", "Work Date - Transmit", each [dateofwork]-[transmit_date]),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Work Date - Transmit", Int64.Type}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type1", "Work On Time", each if[DueDate]<[dateofwork] then "Late" else null),
#"Changed Type2" = Table.TransformColumnTypes(#"Added Custom2",{{"transmit_time", type time}}),
#"Added Custom3" = Table.AddColumn(#"Changed Type2", "Custom", each [DueDate]-[transmit_date]),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom3",{{"Custom", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type3",{{"Custom", "Transmit To Due"}})
in
#"Renamed Columns"
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,215,346
Messages
6,124,417
Members
449,157
Latest member
mytux

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