import data of multiple PDF files to opened file from folder

abdo meghari

Well-known Member
Joined
Aug 3, 2021
Messages
612
Office Version
  1. 2019
is there any way to import data of multiple PDF files to opened EXCEL file from directory without specify the file name as in bold line .

so I want just change this line




Rich (BB code):
let
    #"‏‏source" = Pdf.Tables(File.Contents("C:\Users\MY-NAME\Downloads\MMS\PR-2023-00001 (1).pdf"), [Implementation="1.3"]),
    Table001 = #"‏‏source"{[Id="Table001"]}[Data],
'rest of the  procedures
'

'

like this
"C:\Users\MY-NAME\Downloads\MMS\
indicate where are the PDF files are existed in folder and each PDF file import from the folder for each sheet separately in opened EXCEL file .
thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
is there any way to import data of multiple PDF files to opened EXCEL file from directory without specify the file name as in bold line .

so I want just change this line




Rich (BB code):
let
    #"‏‏source" = Pdf.Tables(File.Contents("C:\Users\MY-NAME\Downloads\MMS\PR-2023-00001 (1).pdf"), [Implementation="1.3"]),
    Table001 = #"‏‏source"{[Id="Table001"]}[Data],
'rest of the  procedures
'

'

like this
"C:\Users\MY-NAME\Downloads\MMS\
indicate where are the PDF files are existed in folder and each PDF file import from the folder for each sheet separately in opened EXCEL file .
thanks
Don't know where you got that code, but it wasn't generated by Power Query. the first line of a PQ generated Query is ALWAYS "Source =". It would NEVER be #"source" as the #"" is only needed when there's a SPACE in the step name.
Use the UI Interface. Go to Data -> Get Data -> From File.. From Folder.
 
Upvote 0
thanks
it imports details file name, directory ...., not data inside the file .

this is the whole code
VBA Code:
let
    #"‏‏المصدر" = Pdf.Tables(File.Contents("C:\Users\MY-NAME\Downloads\tt\PR-2023-00001.pdf"), [Implementation="1.3"]),
    Table001 = #"‏‏المصدر"{[Id="Table001"]}[Data],
    #"الرؤوس التي تمت ترقيتها" = Table.PromoteHeaders(Table001, [PromoteAllScalars=true]),
    #"النوع المتغير" = Table.TransformColumnTypes(#"الرؤوس التي تمت ترقيتها",{{"Sr", Int64.Type}, {"Item Code", type text}, {"Description", type text}, {"Purchase Order", type text}, {"Accepted#(lf)Quantity", type text}})
in
    #"النوع المتغير"
the language is not English in excel , I try writing English that's why shows error.
 
Upvote 0
The data - FILES - are in the Content column.
1677055734659.png

You "Open" them by clicking on the double down arrows at the top right corner of the column.
 
Upvote 0
this is really helpful !:)
would you tell me how select for each file by import data for each sheet individually . now it will import all of data for all of the files in one sheet , I don't wanted . I want each file should be in each sheet separately .
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,195
Members
452,616
Latest member
intern444

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