I'm looking to make a program in Excel VBA that interacts with CorelDRAW via OLE and the COM.
Issue is, even with the proper objects, syntax, and selected references, Excel refuses to accept my code, which looks a little something like this:
Sub mySubroutine(ByRef inArray As Variant) Dim cdrApp As CorelDRAW.Application Set cdrApp = CreateObject("CorelDRAW.Application") 'Lots of irrelevant code here End Sub----------------When I try to compile, I get "Runtime error '-2147418113': class not registered" if I try to define cdrApp as just Object I getanother error when I create the object.Here's where things get really weird. Obviously, something is wrong with my references. So, I go in and I have "Corel - CorelDRAW 24.5 TypeLibrary" and "CorelDRAW - Vector Graphics Core 24.5 Type Library" (the required libraries) plus some others selected. But I notice that I have two duplicate libraries, one for CorelDRAW and one for PHOTO-PAINT. When I try to select these libraires I get "Error in loading DLL." Additionally, I realized that the file locations of these "Phantom" libraries do not exist.
Sub mySubroutine(ByRef inArray As Variant) Dim cdrApp As CorelDRAW.Application Set cdrApp = CreateObject("CorelDRAW.Application") 'Lots of irrelevant code here End Sub
PPPE.tlb exists at the given location. CorelPP.tlb does not.Here's a list of things I have tried to resolve this issue (none worked):- Made a bunch of tweaks to my code, including changing objects to VGCore objects- Repaired, uninstalled, reinstalled Corel programs- installed Corel programs on a 2nd computer- Repaired, uninstalled, reinstalled Microsoft Office- Checked windows registry to see how CorelDRAW registered things (although I admit I really didn't know what I was looking at or for)- Had Corel 2nd level support download my company's edition of CorelDRAW to test it in a virtual machineI've been stuck on this for a month. Please, help.Lastly, I accidentally originally posted this in the code snippets feedback forum. If this duplicates itself, let me know and I will delete the duplicate. I tried to move the original over but from what I can tell it got blocked. Thanks.
"I am not a VBA expert, but in the newer versions of CorelDRAW, the VGCoreAuto.tlb is used as a reference."
VGCoreAuto.tlb
Thanks for the reply. But this is something I had previously tried, and it unfortunately did not work. I went through and selected every single .tlb file in the TypeLibs folder.