Try-Catch Error for Multiple Assign of Variables


I am trying to assign data values to multiple variables:
Data_1= (Data(0)).Trim
Data_2= (Data(1)).Trim
Data_3= (Data(2)).Trim

where Data is an array
But sometimes, there is no value for Data_3

So I get an error

Cannot assign to Data_3

However, I noted that while Data_1 & Data_2 has been assigned. The next steps to write the value into Excel won’t be triggered if I place the Assign + Write Cell activities into the “Try” part.

So how do I solve this?

Thank you


What are the data type of the values of the array? Try to convert them to string.

Apply try catch to assign only so it will catch for that assign only so after performing try catch it will go to write cell…

If you Still not getting then pls share screenshot of that activities that you have used