Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why is this VBA line erroring out?

1 REPLY 1
Reply
Message 1 of 2
Anonymous
900 Views, 1 Reply

Why is this VBA line erroring out?

Little bit of context, I'm updating a VBA macro from the early 2000's to work in 2021 AutoCAD... Lots of little bugfixes mostly related to changes in language or references.

Here is the line that errors out with a "Run-time error '-2147221164(80040154)': Class not registered.".

 

Dim OutPDF as ABCpdf.Doc 'init the ABCpdf 
'uses the OutPDF a few times, works fine
Set OutPDF = New ABCpdf.Doc

 The ABCpdf.Doc works fine in between those two lines, everything executes correctly up until it hits that Set OutPDF line. If there is more context needed for this, I can elaborate further.

Labels (3)
1 REPLY 1
Message 2 of 2
norman.yuan
in reply to: Anonymous

When you said "...a VBA macro from the early 2000's...", it would be safe to say that the VBA code would only be working in 32-bit VBA. With later version of AutoCAD, the VBA is 64-bit, if AutoCAD is 64-bit. So, it is very likely the error is due to the fact the COM component (ABCPdf) used in older VBA code was 32-bit. You need to find a 64-bit version of this component.

 

I am not familiar to ABCPdf, but quick browsing its website does not yield any link to ABCPdf's COM component and all their products seem to be .NET oriented. It is very possible that they have migrated all their PDF products to .NET platform.

 

So, I would assume that you'll have very low chance to find 64-bit COM support from ABCPdf, thus your old VBA code is not fixable. You need to rewrite the program, depending on what it is to do, with AutoCAD built-in PDF plotting/underlaying functionality, or with different technologies, such as AutoCAD .NET API in conjunction with .NET PDF functionality from third parties.

 

 

Norman Yuan

Drive CAD With Code

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report