Ask Your Question
0

IF AND - not correct atribute value [closed]

asked 2020-08-03 22:44:53 +0200

Arrowman gravatar image

updated 2020-08-03 22:51:18 +0200

Hi! I have a difficult problem. When I try to check this:

oView = ThisComponent.getCurrentController()
oSheet = oView.activesheet

cellToCheckLeft = oSheet.getCellByPosition(col, row)
cellToCheckRight = oSheet.getCellByPosition(col + 1, row)

If ( cellToCheckLeft.String <> "" ) AND  ( cellToCheckLeft.String <> "0" ) AND ( cellToCheckRight <> "" )  Then
    isWing = true
Else
    isWing = false
EndIf

I have got an error (sorry translated from my language): not correct atribute value on row:

If ( cellToCheckLeft.String <> "" ) AND  ( cellToCheckLeft.String <> "0" ) AND ( cellToCheckRight <> "" )  Then

I checked Wiki: https://help.libreoffice.org/Basic/If...

Also this forum: https://ask.libreoffice.org/en/questi...

But it works in above excample. Why it is not correct in my code?

THANKS!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by erAck
close date 2020-08-04 01:08:18.177019

Comments

Please check at which case had you forgot the .String 😉

Mike Kaganski gravatar imageMike Kaganski ( 2020-08-03 23:04:03 +0200 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2020-08-03 23:04:13 +0200

erAck gravatar image

The error message is "Incorrect property value" and happens because of cellToCheckRight <> "" where you omitted .String so it should be cellToCheckRight.String <> "" instead.

edit flag offensive delete link more

Comments

f* right. It is too late. Thanks!

Arrowman gravatar imageArrowman ( 2020-08-04 00:11:38 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2020-08-03 22:44:53 +0200

Seen: 23 times

Last updated: Aug 03