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.