I want to read cell H6 (highlight yellow)
In cell H6 sometime show #N/A or number.
But show error Read Cell: #N/A is not a valid value for Int32.
Please guide me about it.
I want to read cell H6 (highlight yellow)
In cell H6 sometime show #N/A or number.
But show error Read Cell: #N/A is not a valid value for Int32.
Please guide me about it.
As you said H6 has valid value and some time invalid value
You can use Try catch activity and place Read cell activity
Hope this may help you
Thanks
@Srini84
How to set try catch?
Can you tell me what you want to do after Read Cell activity also what type of exception you are getting in the error
That you have to select in Catches and give your activities you want to do when exception hits in that block
Hope this may help you
Thanks
@Srini84 After read cell I want to check data in H6 , if data = #N/A write line
If data not = #N/A —> send data to sequence as below.
Try as below
First get the exception type you are getting in Read Cell
Surrond Read Cell with Try Catch, In Try Declare a variable as below
In Catches select the exception and place as below
Now use If condition as below If exception hit or not
Hope this may help you
Thanks
check the exception type as below
You need to make catches with the same exception and place your assign activity as below
Catch->New->Browse for Types->Search for NotsupportedException
Hope this may help you
Try changing variable data type from “Int32” to “Generic value” for Read cell output value.
@sshubham.agrawal93 I can’t change to Generic value.
Because If I change variable rows to another type (except int) it show popup as below.
I was talking about changing data type of the variable used in “Read Cell” Activity.
@sshubham.agrawal93 yes , I understand you.
Change data type variable in output read cell.
But I use same variable in next step. (It want type int only)
If I change to Generic value It error in next step.
in the next step, you can convert the same variable to int32 using below syntax.
Convert.toInt32(“Generic Value variable”)
@sshubham.agrawal93 Error : Assign: Input string was not in a correct format.
My file excel :
data11.xlsx (8.5 KB)
I want to read cell H6
If output = #N/A write line
If data not = #N/A —> send data to sequence as below.
Hi,
The flow should go like this:
1.Read cell (in generic value variable)
2. Check If extracted value = “#N/A”
3. If not then convert.Int32(variable name) (do not use double quotes with the variable name) remove double quotes
4. click img
Hi @fairymemay !
What about using the other read cell with generic value ?
Let us know if it does not work as expected
Hi @fairymemay
Please try this if it works,
Cint(rows.tostring.trim)
Or
Convert.toint32(rows.tostring.trim)
Thanks
You are debugging the workflow, Debug always stops in error even if surrounded by try catch, try to run the workflow and you will see catch is executed
Hope this may help you
Thanks