none
Can you use math equation editor with vba in excel RRS feed

  • Question

  • I have seen you can manipulate the equation editor in word 2007 or 2010 beta with vba but is it possible in excel? I tried copy and pasting but I seems excel vba doesn't recognise those objects / doesn't support those properties. I tried ticking a reference to the word 12.0 library objects through tools but that doesn't seem to make a difference. Anyone had more success here or ideas?
    Tuesday, January 19, 2010 11:26 AM

All replies

  • JD,

    i don't know anything about the math equation editor, but have you tried recording a macro while using it?  that would be the first thing i would try.

    take a look here also  http://office.microsoft.com/en-us/excel/HP102157991033.aspx
     
    FREE
    DEVELOPER TOOLS     CODE     PROJECTS

    DATABASE CODE GENERATOR
    DATABASE / GENERAL  APPLICATION TUTORIAL
    Upload Projects to share or get help on and post the generated links here in the forum
    www.srsoft.us
    Thursday, January 21, 2010 2:17 PM
  • I'm not sure if this is what you need, but if you know the excel functions for equations, such as "sqrt" simply do this

    answer = ExecuteExcel4Macro("sqrt(5)") 'assigns the value of the square root of 5 to "answer"
    put your entire equation in function form into ExecuteExcel4Macro and it will execute as if you were doing it in a cell in a spreadsheet.

    hope that helps

    Daniel
    Thursday, January 21, 2010 2:49 PM
  • Hi JD,

    As far as I know, we could not access equation editor in Excel, this appears as a embedded ole object in Excel.I've tried record a macro as Jeff said, but following code is the only thing I've got:

     ActiveSheet.OLEObjects.Add(ClassType:="Equation.3", Link:=False, _
            DisplayAsIcon:=False).Activate

    Thanks.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, January 25, 2010 8:50 AM