1

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.

jon compton
  • 21
  • 1
  • 7
  • 1
    `OutPDF` does not work fine between these two lines because it remains `Nothing`, and only at the `Set` line it is ever instantiated. The only thing that would "work" with `OutPDF` here is passing it around to methods that don't really use it or gracefully fail when it's `Nothing`. To fix it, properly register the COM library that contains it on your computer. – GSerg Dec 07 '20 at 15:27
  • Wow... I have no idea how I missed that... I've been staring at it way too long. Thank you very much for answering! – jon compton Dec 07 '20 at 15:39

0 Answers0