Message 1 of 3
VB progs for use with Multiple ACAD versions

Not applicable
08-08-2002
02:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all:
Will this code work reliably when setting myApp object on machines with
R14.01 and 2002 installed?
I am just curious (still looking for a machine with R14.01 and 2002
installed) if this is a correct/good technique.
Thanx, Gary
.
.
.
On Error Resume Next
Set myApp = GetObject(, "AutoCAD.Application")
If err Then
err.Clear
MsgBox "AutoCAD® is not currently running... ", vbInformation
End
End If
pstrVersion = myApp.Version
Select Case True
Case InStr(pstrVersion, "14.") > 0
Set myApp = Nothing: Set myApp = GetObject(,
"AutoCAD.Application.14")
Case InStr(pstrVersion, "15") > 0
Set myApp = Nothing: Set myApp = GetObject(,
"AutoCAD.Application.15")
Case Else
MsgBox "Error starting AutoCAD®" , vbCritical: End
End Select
.
.
.
Will this code work reliably when setting myApp object on machines with
R14.01 and 2002 installed?
I am just curious (still looking for a machine with R14.01 and 2002
installed) if this is a correct/good technique.
Thanx, Gary
.
.
.
On Error Resume Next
Set myApp = GetObject(, "AutoCAD.Application")
If err Then
err.Clear
MsgBox "AutoCAD® is not currently running... ", vbInformation
End
End If
pstrVersion = myApp.Version
Select Case True
Case InStr(pstrVersion, "14.") > 0
Set myApp = Nothing: Set myApp = GetObject(,
"AutoCAD.Application.14")
Case InStr(pstrVersion, "15") > 0
Set myApp = Nothing: Set myApp = GetObject(,
"AutoCAD.Application.15")
Case Else
MsgBox "Error starting AutoCAD®" , vbCritical: End
End Select
.
.
.