Automate Visio 2010 from Excel 2013

Started by Thomas Winkel, July 04, 2015, 05:57:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thomas Winkel

Hi,

I have VBA code in an Excel document that controls a Visio application:
Set vApp = GetObject(, "Visio.Application")

In the references I checked:
Microsoft Visio 14.0 Type Library

On a computer with Excel 2010 and Visio 2010 this works.
But on a computer with Excel 2013 and Visio 2010 I get an "Automation error, Library not registered".
I already tried to reinstall Visio and to repair my Office installation with no effects.

Any ideas?

Best regards,
Thomas

Surrogate


Thomas Winkel

With late binding it's working.

I guess there is an error in my Visio / Office installation.
For other Office applications the answer is to delete a specific registry key:
http://darrenmyher.com/2013/05/23/after-uninstalling-outlook-2013-get-automation-error-library-not-registered-when-attempting-to-create/

Something like this should also work for me, because I had Visio 2013 installed before for test purposes.

Best regards,
Thomas

Thomas Winkel

Ok, I followed the instruction of the first answer here:
https://social.msdn.microsoft.com/Forums/en-US/d35f6852-8770-4503-8428-4a7040b654cd/suddenly-automation-error-library-not-registered?forum=isvvba
and deleted all keys in the registry that contained "Microsoft.Office.Interop.Visio" and referred to version 15 (Visio 2013).
Now it's working.

But it took me an hour to delete all those keys...
Many of our users will have the same problem because they had Visio 2013 installed before we decided to go with Visio 2010.
Is there a quicker way to repair the registry?

Regards,
Thomas

Surrogate

What about registry cleaners? You also can write code that clean it.

Thomas Winkel

CCleaner did not solve the problem.
But a concerned colleague located the causal registry key.
The following reg file fixes the issue:


Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TypeLib\{00021A98-0000-0000-C000-000000000046}\4.f]