cancel
Showing results for 
Search instead for 
Did you mean: 

Globals object in a spreadsheet rule

sudarshan
New Contributor II

Even a simple globals.getObject("_ex") throws a object reference not found error. Is the use of the globals object prohibited inside a spreadsheet rule?

The code:

sudarshan_0-1653650729608.png

Error log when this spreadsheet rule is used:

sudarshan_2-1653650913132.png

But if I comment out line number 24, the error log becomes: 

sudarshan_3-1653650941609.png

 

 

1 ACCEPTED SOLUTION

Yes that should work. 

The only solution I can think of for this is to perform the global operations in an extensibility rule and return the object back to the spreadsheet by referencing it.

Thanks,
Bharti Paryani

View solution in original post

3 REPLIES 3

BhartiParyani
Contributor

Hi Sudarshan,

Try holding the object returned by getobject in a datatable or a string,

Dim dt As DataTable = globals.GetObject("Example")

Check if dt has any rows then access the same 

Or in a string 

Dim sGlobalObject As String = globals.GetObject("Example").ToString

Check if string is not null then use it.

Hope this helps.

Thanks,

Bharti

 

Thanks,
Bharti Paryani

sudarshan
New Contributor II

Hi Bharti,

Upon trying this I am still facing the same issue, the updated code:

sudarshan_3-1653660388717.png

 

sudarshan_1-1653659840659.png

The code is still failing when either trying to perform either a set or get operation on the globals object

sudarshan_2-1653659960906.png

This same piece of code works perfectly when executed in an extensibility rule. The only solution I can think of for this is to perform the global operations in an extensibility rule and return the object back to the spreadsheet by referencing it.

 

Thanks

Yes that should work. 

The only solution I can think of for this is to perform the global operations in an extensibility rule and return the object back to the spreadsheet by referencing it.

Thanks,
Bharti Paryani