Invoke code returns error

I’m getting below error when invoke code to hide rows.However the arguments rangeToHideinexcel,excelSheet,excelFileP have values passed in arguments.

How do we find which one is empty?

System.NullReferenceException: Object reference not set to an instance of an object.\r\n at UiPathCodeRunner_922aa3fb59f64434a743206d4ec1bf48.Run(String excelFileP, String excelSheet, String rangeToHideinexcel)

Is it possible for you share your workflow?

1 Like

Issue was with mismatch variables

1 Like

Hello @ranjani
Is the Workfllow woking before ? If yes, Could you please check the path created , if the files not moved to another location :
“C:\test.xlsx” & “C:\test\test.png”

Did you mis spell variable here instead of excelFilePathT?

1 Like

it isn’t working before.Just change few names…

1 Like

i have changed few things before posting and missed to update those part.Variables are correctly mapped in the actuals. not sure why i m getting the error still.

Those Changes may affect your code, as highlighted by @Surya_Narayana_Korivipadu , what is declared as variable excelFilePathT is not the same as what is written in the remaining part of the code excelFilePath, review this and check.

in actuals its perfect. no issues with the name

Hi @ranjani , What do you mean by “in actuals its perfect” , Is the Problem fixed or the variables are OK?

I have modified the actual code a bit like changing variables and path and posted .So while changing i missed to change two of them but everything is fine in actual code

Good to Know. If you can just share what has been corrected ( New Code) and set this Topic as solved ( By @Surya_Narayana_Korivipadu ). Thanks

I still find issues with this code. The variable excelApp is not declared