How to add multiple invoices in pdf format to a single excel file?

I get a large volume of invoices in email, I save them in a folder and check indivually and add them to different excel files after validation, for example if I have 4 invoices 4 different excel files are created. How do I add them all in the single excel file, meaning the bot should create only one excel file for all the 4 invoices.

1 Like

@Harshita_Ramesh
Hi,
Please get all your files in string array and put loop and inside loop put this script.
Hopefully, to get you on the right path, you can consider the following general VBA script. To embed objects in the cells.

Sub AddingObjects()

Range("A1").Select
ActiveSheet.OLEObjects.Add(Filename:= " <Path of your PDF> " _
,Link:=True, DisplayAsIcon:=True, IconFileName:= _
    "C:\WINDOWS\Installer\{AC76BA86-7AD7-1033-7B44-AC0F074E4100}\PDFFile_8.ico", _
    IconIndex:=0, IconLabel:=" <Icon Label Name> ").Select
End Sub

You have to make changes according to your requirement and you can change the Icon of your embedded object i.e PDF (Here I used default PDF icon)
Hopefully, this will suffice your requirement.

1 Like

Thanks for your reply, but I am very new to uipath and have never used VBA script until now I am not sure how to use thos :frowning:

@Harshita_Ramesh can you share how you are adding one file. Please share your workflow

Sure,
pdf Extraction.xaml (46.7 KB)

hi another approach you can try is to save your invoice excel extractions in a temporary location and join them together, this is non complicated approach since you are new. here’s a tutorial on how to do it.

@Harshita_Ramesh so you want to extract data and store in data. Am I right?

Or

You want add pfd as a object in excel file.

I want to store the extracted data in a single excel sheet currently multiple excel files are being created for multiple invoices

Will try this as well, thanks

@Harshita_Ramesh ok so ignore vb Script.
I have got to look your solution but I am unable to read.
image

Here I am sharing sample code where I am reading multiple pdfs and storing in one excel file.
you can map in solution I think you need to put just loop and Add data row activity.
PdfFile1.xlsx (7.3 KB)
ExtractDatafromPDFRegex.xaml (10.7 KB)



I am not sure why that is not visible

@Harshita_Ramesh its version compatiability issue, you are using latest one I think so

Oh!! Ok

So I have used Machine learning extractor here will the code work for that as well?

@Harshita_Ramesh Can you show me your packages

@Harshita_Ramesh I am giving you hint.
Current you are reading pdfs and making separate excel for each pdf.

Now do these steps.
1-Before making excel file check that excel file is present
if present then read tha and merge with current datatable and then again write margeDataTable in that file.
else->simple write current datatable in it.

Note: Excel sheet should be constant.

1 Like

Will try to follow your steps and get back to you if it does not works. Thank you so much for you help

@Harshita_Ramesh yes I am confident about steps, these are working logic. I am here you can share anything

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.