Okkookk

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?

1 Like

Hi @Sadder

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

cheers

Hi @Sadder

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

Regards
Gokul

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

Hi @Sadder

Create the Variable 2 as Object

image

Regards
Gokul

Hi @Sadder

The specified variable is not existing or the scope of it is wrong. Change the scope if it is already there under variables

Cheers

HI @Sadder

Can you check the Dt_PDFextract is declared inside the scope or you didn’t declared the variable.

Regards
Gokul

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

1 Like

HI @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

cheers

Hi @Sadder

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

cheers

1 Like

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.

HI @Sadder

In message box use sumVariable.ToString

That will solve the issue

cheers

Hi @Sadder

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

cheers

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

hi, document is invalid

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