Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't close MathCAD using automation from VB

Status
Not open for further replies.

sfatz

Structural
Jul 14, 2004
8
I have a Visual Basic front end to a Mathcad 12 worksheet. The VB app binds user input to variables in the MathCAD worksheet and gets the results without too much trouble.

The problem I have is when the user is done with the app. I can close the MathCAD worksheet, but I can't seem to close the MathCAD application's process. I have tried setting it to Nothing, but it still remains. What is the code to completly close the application?

-----
'declaration statements
Public MC As Mathcad.Application
Public WK As Mathcad.Worksheets
Public WS As Mathcad.Worksheet

'code to cleanup
WS.Close SaveOption:=mcDiscardChanges
Set WS = Nothing
Set WK = Nothing
Set MC = Nothing
-----
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor