### [Solved] Macro Inserting OOo Math Formula in Calc

Posted:

**Sun Nov 13, 2011 7:08 pm**I'm really desperated. I have spent two days looking for any solution but i found only information how to insert formula in Writer or how to start editing MathFormula in Calc, but nothing about how to make and edit Math Formula in Calc....

Authomatic recorded macro using "record macro" gives such a result:

It opens Math Formula Editor, and nothing more

In Writer it is easy. It's only needed to use o >>CLSID = "078B7ABA-54FC-457F-8551-6147e776a997"<< formula to an object.

Then I set the "formula" property of my object which is EmbeddedObjcet (for example: oObj.EmbeddedObject.formula = "My formula") and then it works good. But it's in Writer. How to get it in Calc? Is there any equivalent of "EmbeddedObject" object from Writer's document in Calc Spreadsheets? Can anyone help me?

Sorry for my complicated explanation and poor english.... And thank You very much for every suggestion.

Authomatic recorded macro using "record macro" gives such a result:

- Code: Select all Expand viewCollapse view
`document = ThisComponent.CurrentController.Frame`

dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------

dispatcher.executeDispatch(document, ".uno:InsertObjectStarMath", "", 0, Array())

rem ----------------------------------------------------------------------

dispatcher.executeDispatch(document, ".uno:InsertObjectStarMath", "", 0, Array())

It opens Math Formula Editor, and nothing more

In Writer it is easy. It's only needed to use o >>CLSID = "078B7ABA-54FC-457F-8551-6147e776a997"<< formula to an object.

Then I set the "formula" property of my object which is EmbeddedObjcet (for example: oObj.EmbeddedObject.formula = "My formula") and then it works good. But it's in Writer. How to get it in Calc? Is there any equivalent of "EmbeddedObject" object from Writer's document in Calc Spreadsheets? Can anyone help me?

Sorry for my complicated explanation and poor english.... And thank You very much for every suggestion.