VBA method now only works on new documents!

Hi folks,

For the first time in years of using some macros I wrote, I've come across a problem I can't quite figure it out.

A number of macros I wrote make a copy of the active document and the apply some various effects to the copy with-out risk to the original.

Yesterday afternoon this macro attempted to do a PDF export of a very simple item (3 objects, solid fills, no effects) which crashed my system. 

On reboot Coreldraw would no longer start under my profile, even with an attempted F8 start-up.

The fix for that was renaming the Coreldraw entry in the registry so that the Coreldraw could recreate it.

Now, back up and running my macro no longer functions on existing files.

Looking at the script, literally the first things it does are (after defining the variables):

set actDoc = Activedocument

set targetDoc = actDoc.Duplicate

The second line throws up an error dialog that reads:

Run-time error "-2147467259 (80004005)':

Method 'Duplicate' of object 'IVGDocument' failed.

actDoc shows the file name, but I have no idea why the Duplicate is failing now on existing files.

Anyone seen the likes of this before?

  • After trial and error I found the answer for this one.

    As this was a reinstall of Coreldraw on my workstation I had not set-up the Corel Font Manager.

    The error was the result of Coreldraw not being able to find the font required by the document (even though it was embedded in the original).  Once I pointed Font Manager at the appropriate directories the error stopped.

    Certainly a little more verbose error message would have made life easier!