Source Using Cell Addresses

hatstand

Well-known Member
Joined
Mar 17, 2005
Messages
778
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I am trying to convert a bit of code that uses cells to hold the Folder Path and File Name. This works perfectly for Excel files. I am now trying to modify the code to import a csv fie, but failing. If anyone could offer any advice it would be much appreciated.

FilePath = Excel.CurrentWorkbook(){[Name="Folder_Path"]}[Content]{0}[Column1],
FileName = Excel.CurrentWorkbook(){[Name="File_Name"]}[Content]{0}[Column1],
Source = Excel.Workbook(File.Contents(FilePath & FileName), null, true),


FilePath = Csv.Document(){[Name="Folder_Path"]}[Delimiter=",", Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.None],
FileName = Csv.Document(){[Name="File_Name"]}[Delimiter=",", Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.None],[Content]{0}[Column1],
Source = Csv.Document(File.Contents(FilePath & FileName), null, true),
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,215,575
Messages
6,125,613
Members
449,238
Latest member
wcbyers

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