Message 1 of 6
run VB6 application with different Autocad Version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a Visual Basic 6.0 Project , to manage CAD Data
I want to open a file in Autocad
1) in VB6 , I add Project / Reference / Autocad 2006 Type Library
2) I use following code (see below) , to select application , start Autocad if not already started , open File
3) I compile Mycode : MyCADProject.exe
=> start MyCADProject.exe , I select a DWG file and I can open the file in Autocad 2006 : OK
Problem , I have new PC one with Autocad 2010, one with Autocad 2009 (all other PC are with Autocad 2006)
in My VB6 Project
1) I can not sellect both library "Autocad 2006 Type Library" and "Autocad 2007 Type Library"
=> I get a Windows error Message "Librairie déja utilisée"
2) If I select only one Library , this run well for one version of Autocad , but not fot the other version !
I want to manage only one version of MyCADProject.exe
I do not find any solution on this forum
Is is possible to run a VB6 project with different version of Autocad ?
Dim Acadapp As AcadApplication
On Error Resume Next
Set Acadapp = GetObject(, "AutoCAD.Application")
If Err.Number <> 0 Then
On Error GoTo 0
Set Acadapp = CreateObject("AutoCAD.Application")
End If
Acadapp.Documents.Open (Myfile)
Acadapp.Visible = True
I have a Visual Basic 6.0 Project , to manage CAD Data
I want to open a file in Autocad
1) in VB6 , I add Project / Reference / Autocad 2006 Type Library
2) I use following code (see below) , to select application , start Autocad if not already started , open File
3) I compile Mycode : MyCADProject.exe
=> start MyCADProject.exe , I select a DWG file and I can open the file in Autocad 2006 : OK
Problem , I have new PC one with Autocad 2010, one with Autocad 2009 (all other PC are with Autocad 2006)
in My VB6 Project
1) I can not sellect both library "Autocad 2006 Type Library" and "Autocad 2007 Type Library"
=> I get a Windows error Message "Librairie déja utilisée"
2) If I select only one Library , this run well for one version of Autocad , but not fot the other version !
I want to manage only one version of MyCADProject.exe
I do not find any solution on this forum
Is is possible to run a VB6 project with different version of Autocad ?
Dim Acadapp As AcadApplication
On Error Resume Next
Set Acadapp = GetObject(, "AutoCAD.Application")
If Err.Number <> 0 Then
On Error GoTo 0
Set Acadapp = CreateObject("AutoCAD.Application")
End If
Acadapp.Documents.Open (Myfile)
Acadapp.Visible = True