title: OMath output and display of fractions into Excel
body: <p><strong>INTRO</strong><br />
  With this code it is possible to display mathematical equation within a WORD document:</p>
  <pre class="lang-vb prettyprint-override"><code>Sub genEQ()
      Dim objRange As Range
      Dim objEq As OMath
      Dim AC As OMathAutoCorrectEntry
      Application.OMathAutoCorrect.UseOutsideOMath = True
      Set objRange = Selection.Range
      objRange.Text = &quot;Celsius = \sqrt(x+y) + sin(5/9 \times(Fahrenheit – 23 (\delta)^2))&quot;
      For Each AC In Application.OMathAutoCorrect.Entries
          With objRange
              If InStr(.Text, AC.Name) &gt; 0 Then
                  .Text = Replace(.Text, AC.Name, AC.Value)
              End If
          End With
      Next AC
      Set objRange = Selection.OMaths.Add(objRange)
      Set objEq = objRange.OMaths(1)
      objEq.BuildUp
  End Sub
  </code></pre>
  <p>An with this code I am able to display UNICODE characters within EXCEL message boxes without displaying &quot;?&quot; or &quot;random characters&quot;:</p>
  <pre class="lang-vb prettyprint-override"><code>Private Declare PtrSafe Function MessageBoxW Lib &quot;User32&quot; (ByVal hWnd As LongPtr, ByVal lpText As LongPtr, ByVal lpCaption As LongPtr, ByVal uType As Long) As Long
  
  Public Function MsgBoxW(Prompt As String, Optional Buttons As VbMsgBoxStyle = vbOKOnly, Optional Title As String = &quot;Microsoft Excel&quot;) As VbMsgBoxResult
      MsgBoxW = MessageBoxW(Application.hWnd, StrPtr(Prompt), StrPtr(Title), Buttons)
  End Function
  </code></pre>
  <p><strong>QUESTION</strong></p>
  <ol>
  <li><p>Is there now a way to combine those and display a complete equation within a message box in EXCEL?<br />
  Further how do I refer to MS WORD with the above code snippet to be run within EXCEL?</p>
  </li>
  <li><p>Is there a way to display a fraction like in the formula of the first code without making a string with a &quot; / &quot;-symbol?</p>
  </li>
  </ol>