I would like to extract the values from a PDF file, to sum up the total value for each of the invoice. However, i have encountered the error message: “Option Strict On disallows implicit conversions from ‘Object’ to ‘Integer’” when I want to extract the value from the PDF. Anyone can help to draw insight on what is this error and why has this error occured?
the error says you are trying to use a variable type of object instead of integer.
if you want to convert use Cint(variable) to convert as Integer. But make sure your variable has integer in it
Welcome to Uipath community
Can you share the screenshot of the error and tell us in which activity did you received an error?
If you are using for each or switch activity update the TypeArgument
please see my reply below, sorry im new to this and not sure how to navigate around
hi, please see my reply below, sorry im new to this and not sure how to navigate around
Create the Variable 2 as
The specified variable is not existing or the scope of it is wrong. Change the scope if it is already there under variables
Can you check the
Dt_PDFextract is declared inside the scope or you didn’t declared the variable.
I have declared variable2 before this step however, why does it says that the variable cannot be found?
Can you tell us what do you need to achieve ? @Sadder
First the error is because of the right side part where you gave compute and all… That step is wrong. Please tell us what you are trying to do with compute
So first follow these steps
create and initialize sum variable with int32 datatype and default value as 0
use a for loop to loop through the invoices and say you are getting the total into variable x
then in the loop itself after getting total to x use an assign
sum = sum + Cint(x)
and once the loop is completed you will have your sum
Hi @Sadder ,
Based on the Statement provided above, You do already have the Invoice Data Extracted from the PDF. Could you show us how it is being stored ?
Could you maybe provide us with the Table Data that is extracted or write it to an Excel sheet using Write Range ? Just to confirm that the data is being extracted properly.
In message box use sumVariable.ToString
That will solve the issue
@supermanPunch @Anil_G @Gokul001 thanks for your suggestions, however, error still occured. it shows multiple message box stating each of the individual invoice amount due, instead of showing the total sum of all the invocies.
may i check if anyone are okay with me uploading the file here and assist to troubleshoot from there? your help is greatly appreciated.
Please send xaml/screenshot .files would be best
Are you setting sumvariable to zero always again?
I you show the flow completely we can find the issue
As You are able to get individual values you are almost at the end of getting sum…May be a single step would take you there
hi, it says document invalid, may i know why is this the case? and may i know what have you changed so that if i am still unable to open your file, i would be able to still get my result. Sorry for the inconvenience!!
I have created a new account as my account has reached its maximum replies
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.