Forum Discussion

Bridgett_B's avatar
Bridgett_B
Copper Contributor
Feb 29, 2024

Power Query import using relative path of PDF file error

Hello, I have a query that currently imports a pdf file based on a specific file name and location.  I'm trying to make the file name and location relative but keep getting an error.  I'm using Exce...
  • Riny_van_Eekelen's avatar
    Mar 01, 2024

    Bridgett_B 

    The first three lines of M-code should look like this:

    FolderPath = Excel.CurrentWorkbook(){[Name="FolderPath"]}[Content]{0}[Column1],
    PCRFileName = Excel.CurrentWorkbook(){[Name="PCRFileName"]}[Content]{0}[Column1],
    Source = Pdf.Tables(File.Contents(FolderPath & PCRFileName), [Implementation="1.3"]),

    Now you can navigate to the table(s) you want to extract from the PDF.

Resources