1

I'm trying to open a MathCAD application using excel VB code. But I'm getting a runtime error "-2147220992 (80040200)". I have an indication as Automation error. Add your comments to solve this.

Dim eWS As Mathcad.Worksheet

Set eApp = CreateObject("Mathcad.Application")
eApp.Visible = True
Path = "C:\Desktop\Test.xmcd"
Set eWS = eApp.Worksheets.Open(Path)
Ramyaa V S
  • 21
  • 2
  • 1
    `As Mathcad.Worksheet` - so the type library is referenced? Why not `Set eApp = New Mathcad.Application` then? Which line is throwing the error? – Mathieu Guindon Mar 29 '19 at 21:15
  • HResults with facility code 4 means the HResult contains OLE errors (0x0 to 0x1ff) while the rest of the range (0x200 onwards) is component specific errors so 20e from one component will have a different meaning to 20e from another component. This is why the source of the error is extra important for errors above 0x80040200. – Noodles Mar 29 '19 at 21:37

0 Answers0