Cell properties - CellHoriJustify - Calc - Error: 0x800405E9

asked 2019-01-31 13:18:16 +0100

Albireo gravatar image

Hello! I'm try to use cell properties. (as example found in OOME 4.0, Macros Explained, from Andrew Pitonyak)

(Code = Autohotkey) oCell.HoriJustify := com.sun.star.table.CellHoriJustify.CENTER

But it generate errors (From Autohotkey?)

  1. Warning: This variable has not been assigned a value. Specifically: com (a global variable) ...

  2. Error: 0x800405E9 Source .: [automation bridge] Description: InterfaceOleWrapper_Impl::Invoke: [automation bridge]UnoConversionUtilities<t>::variantToAny Cannot convert the value of vartype :"8" to the expected UNO type of type class: 15 HelpFile: (null) HelpContext: 0 Specially: HoriJustify ....

(I hope it's possible to read the second error message. I don't know how to get line breaks in the text ...)

But, if I use this command, it works. oCell.HoriJustify := "1"

Is there any documentation on this?

What value corresponds to what? no 0 ?? No. 1 left? no 2 center? no 3 right? no 4 ?? no 5 fill? no 6 ?? and so on.

If I use this program sequence

oCell := oSheet.getCellRangeByName("F10")
oCell.HoriJustify := "3"    ; Right?
oCell.RotateAngle := "4500"  ; 45 degrees?
oCell.setString("Hello baby!")

The text seems to be in cell G10 instead of F10, as my wish. Why?

edit retag flag offensive close merge delete

Comments

Thanks! It seems to work in LibreOffice, but ... my question remains! It doesn't work for me.

If I use .: oCell.HoriJustify := "5" in the following sequence

oCell := oSheet.getCellRangeByName("F14")
oCell.HoriJustify := "5"
oCell.RotateAngle := "0"
oCell.setString("Hello!")

I got two "Hello!" in cell F14 (Left adjusted) - Intresting!

Have I forgotten something, in order to use HoriJustify (or VertJustify)? Is "com.sun.star.table.BorderLine" right service? (or is BorderLine2 better?)

Albireo gravatar imageAlbireo ( 2019-01-31 13:58:50 +0100 )edit

5 is REPEAT, so the repeated text is expected. Did you try to get what you want using UI?

Mike Kaganski gravatar imageMike Kaganski ( 2019-01-31 14:25:04 +0100 )edit