Instance not set as an object

Hello partners .

while I debug my code. it shows me an error saying (INSTANCE NOT SET AS OBJECT). This only tells me when I add a new sequence to my code. Why is this happening ?

Hi @Ana_Patricia_Garcia
There were several reasons why this error Object reference not set to an instance of an object comes are listed below:

->The null value of variable or argument
->A null value for any activity from which you are getting the text from any website.
->Maybe you have created duplicate variables.**
->Import arguments are not updated.
These are general problems, Can i see your problem

I have the code with sequences.


when adding the new sequence I don’t get an error.
but when debugging yes.

The other sequences have INVOKE FLOW.

I only have to add new activities to the diagram but it asks me to set the object instance.

maybe I should add the invoke flow again?

@Ana_Patricia_Garcia First of all sorry, I am not able to understand you studio language.
But I think its veriables or argument issue.
In sequence you are getting veriables from another sequence is not initialize or have a wrong scope. Please check veriables/arguments.

@Ana_Patricia_Garcia I have faced this issue.
Which was basically a dictionary variable and I was getting its value before filling dictionary.
That’s was a little scope mistake.

Please check your veriables scope. For this run on debug mode and get exact location of error and then check scope of variables.

1 Like

Hi @Ana_Patricia_Garcia
The issue seems to be with Excel Application Scope activity. Can you check the if the filename provided in that activity exists?

Also can you provide screenshot of the Excel Application Scope activity and its properties please?

1 Like

Hello here is the capture


I also have my dictionary configured with the correct data.

I also notice this problem when I add the new sap sequence, the problem is when I add a new sequence and new activities.


number 1.

is an example of the sequences as you can see, it contains two
*invoke flow.

The number 3.
the workflow containing the sequence code opens.

The number 2.
It’s my new sequence. the same one that gives me the error.

Hello @Ana_Patricia_Garcia

Try This,

Step 1:
Can you add a Breakpoint (using F9) at Step 1,2 and 3:
image

Step 2:
Then run in debug mode,

Step 3:
Then open the “Locals” panel.

Step 4:
Then watch your variable and check that the value is populated throughout your workflow. I would also look at the scope column within the Variables and Arguments panel.

Hopefully this helps

Cheers

Steve

1 Like