Hi all of you,
after upgrading the newest autocad2022 my excel program can not connect to autocad. Excel program was done in 2010 via visual basic. I use it to read objects from autocad and create list in excel sheet. It stops at stage launching autocad with error message Run-time error '-2147221164 (80040154)' class not registered.
Ive tried repair and reinstal office from 64bit to 32bit. However without succes. It always stucks after clicking debug
at launch autocad. It highlights in yellow(Set AcadApp = New AcadApplication) please see part of scrip below
' launch AutoCAD
Set AcadApp = New AcadApplication
' open the AutoCAD drawing
AcadApp.Documents.Open file_path
errors:
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
AcadApp.Application.Visible = True
Set ssAperture = AcadApp.ActiveDocument.SelectionSets.Add("SS1")
FilterType(0) = 8
FilterData(0) = "TF EXT APERTURE"
ssAperture.SelectOnScreen FilterType, FilterData
On Error GoTo End10
If ssAperture.Count = 0 Then
AcadApp.ActiveDocument.SelectionSets.Item("SS1").Delete
GoTo errors
Else
End If
Solved! Go to Solution.
Hi all of you,
after upgrading the newest autocad2022 my excel program can not connect to autocad. Excel program was done in 2010 via visual basic. I use it to read objects from autocad and create list in excel sheet. It stops at stage launching autocad with error message Run-time error '-2147221164 (80040154)' class not registered.
Ive tried repair and reinstal office from 64bit to 32bit. However without succes. It always stucks after clicking debug
at launch autocad. It highlights in yellow(Set AcadApp = New AcadApplication) please see part of scrip below
' launch AutoCAD
Set AcadApp = New AcadApplication
' open the AutoCAD drawing
AcadApp.Documents.Open file_path
errors:
Dim FilterType(0) As Integer
Dim FilterData(0) As Variant
AcadApp.Application.Visible = True
Set ssAperture = AcadApp.ActiveDocument.SelectionSets.Add("SS1")
FilterType(0) = 8
FilterData(0) = "TF EXT APERTURE"
ssAperture.SelectOnScreen FilterType, FilterData
On Error GoTo End10
If ssAperture.Count = 0 Then
AcadApp.ActiveDocument.SelectionSets.Item("SS1").Delete
GoTo errors
Else
End If
Solved! Go to Solution.
Solved by norman.yuan. Go to Solution.
Solved by ed57gmc. Go to Solution.
I think it's the other way around. They need to to to Tools>References in Excel ide and uncheck the "MISSING:" reference, then select the correct tlb for AutoCAD 2022.
I think it's the other way around. They need to to to Tools>References in Excel ide and uncheck the "MISSING:" reference, then select the correct tlb for AutoCAD 2022.
Just want to confirm that when you say "...Excel program was done in 2010 via visual basic...", you mean it is an Excel VBA program, running inside Excel, the Excel itself is 64-bit (part of Office 365), the the VBA code was originally against AutoCAD 2010. And now the AutoCAD is upgraded to AutoCAD 2022.
You simply open the Excel's VBA editor, click menu "Tools"->"References...". In the dialog box, looking for the checked reference to "AutoCAD20xx Type Library". That reference may still set to AutoCAD2010. If so, you need to uncheck it and find "AutoCAD 2021 Type Library" (AutoCAD 2021 and 2022 both come with "AutoCAD 2021 Type Library" for their COM API). Make sure you tick the check box and OK the dialog box. Then you may want to click menu "Debug->Compile xxxxx" to make sure the VBA code can pass the compile.
Norman Yuan
Just want to confirm that when you say "...Excel program was done in 2010 via visual basic...", you mean it is an Excel VBA program, running inside Excel, the Excel itself is 64-bit (part of Office 365), the the VBA code was originally against AutoCAD 2010. And now the AutoCAD is upgraded to AutoCAD 2022.
You simply open the Excel's VBA editor, click menu "Tools"->"References...". In the dialog box, looking for the checked reference to "AutoCAD20xx Type Library". That reference may still set to AutoCAD2010. If so, you need to uncheck it and find "AutoCAD 2021 Type Library" (AutoCAD 2021 and 2022 both come with "AutoCAD 2021 Type Library" for their COM API). Make sure you tick the check box and OK the dialog box. Then you may want to click menu "Debug->Compile xxxxx" to make sure the VBA code can pass the compile.
Norman Yuan
Briliant, it start working after setting new autocad library. Thank you very much...nobody on the planet earth didnt know what to do except you. You made me the happiest person on planet. Thanks so much
Briliant, it start working after setting new autocad library. Thank you very much...nobody on the planet earth didnt know what to do except you. You made me the happiest person on planet. Thanks so much
Can't find what you're looking for? Ask the community or share your knowledge.