Message 1 of 3
Mcad Application Get/CreateObject problem with MDT5/MDT6 on same machine

Not applicable
12-27-2001
12:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
use the following VB code to set the ACADAPP and MCADAPP variables to the
respective applications via late binding.
This code works fine for MDT5 and MDT6, but when both are installed the last
line bombs out with an error: "Problem in loading application." This also
occurs through VBA. IT works fine when I have just MDT5 or just MDT6 on a
machine. How can I fix this problem?? In the registry, there is a
Mcad.Application and an Mcad.Application.2 entry for classes. We are in the
process of converting to MDT6 and will be leaving MDT5 on the systems, so
this needs to work with both versions.
Dim acadApp as Object
Dim mcadApp as Object
On Error Resume Next
Set acadApp = GetObject(, "Autocad.Application")
If Err = 429 Then 'if Acad Application is not open...
Set acadApp = CreateObject("AutoCAD.Application")
acadApp.Visible = True
acadApp.WindowState = acMax
DoEvents
End If
Set mcadApp = acadApp.GetInterfaceObject("Mcad.Application")
Thanks for your help,
Jody Whitfill
respective applications via late binding.
This code works fine for MDT5 and MDT6, but when both are installed the last
line bombs out with an error: "Problem in loading application." This also
occurs through VBA. IT works fine when I have just MDT5 or just MDT6 on a
machine. How can I fix this problem?? In the registry, there is a
Mcad.Application and an Mcad.Application.2 entry for classes. We are in the
process of converting to MDT6 and will be leaving MDT5 on the systems, so
this needs to work with both versions.
Dim acadApp as Object
Dim mcadApp as Object
On Error Resume Next
Set acadApp = GetObject(, "Autocad.Application")
If Err = 429 Then 'if Acad Application is not open...
Set acadApp = CreateObject("AutoCAD.Application")
acadApp.Visible = True
acadApp.WindowState = acMax
DoEvents
End If
Set mcadApp = acadApp.GetInterfaceObject("Mcad.Application")
Thanks for your help,
Jody Whitfill