Hi
I am using Desktop.Grid and have tried the following code -
If sheet.Cells(9, 1).Value = "" Then
End If
I get the error Option Strict On disallows operands of type 'Object' for operator '='. Use the 'IS' operator to test for object identity
Can you advise please
Regards
Bob Hamill
Hi Bob,
Perhaps you forgot, in VB, when you use Option Strict On in the general declaration section, you should implement proper type casting in your code for classes, objects, methods, properties etc. If you set Option Strict Off, you don't need to do that.
Generally there are two ways to resolve this:
1). Option Strict On
.
.
.
Dim sheet As Worksheet = GridDesktop1.Worksheets(0)
If sheet.Cells(9, 1).Value Is Nothing Then
'your code goes here.
End If
'OR
2). Option Strict Off
.
.
.
Dim sheet As Worksheet = GridDesktop1.Worksheets(0)
If sheet.Cells(9, 1).Value = "" Then
'your code goes here.
End If
Thank you.
Thanks very much Amjad - works perfectly
Regards
Bob Hamill