Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-28-2019, 09:14 AM
sts023 sts023 is offline Opening Excel from Word gets "Automation Error - Library not registered" Windows 10 Opening Excel from Word gets "Automation Error - Library not registered" Office 2010
Hopeless Idiot
Opening Excel from Word gets "Automation Error - Library not registered"
 
Join Date: Apr 2019
Location: God's Own County
Posts: 26
sts023 is on a distinguished road
Default Opening Excel from Word gets "Automation Error - Library not registered"

I'm working in Office 2010, using Excel 2010 and Word 2010.

when I try to open an Excel 2010 spreadsheet in Word 2010. I get the message "Automation Error - Library not registered". This code is part of an on-going project which used to work fine (until my old Windows 7 PC blew up).

Having tried to research this I think I may know what the problem is, but I'm not sufficiently skilled to work out the solution.

I think it's because when I bought my new PC it had a trial version of Office 365 installed. As I already have a fully licensed version of Office 2010 which I am quite happy with, I uninstalled Office 365 before the "end of trial approaching" nag screens started.


I have the following references checked
Visual Basic For Applications
Microsoft Word 14.0 Object Library
OLE Automation
Normal
Microsoft Office 14.0 Object Library


Microsoft Excel 14.0 Object Library

My simplified code follows

Code:
Option Explicit
Public Sub GetDataFromExcel()
Dim appExcel                As Excel.Application
'*
'** Create a new Excel application.
'*
  Set appExcel = New Excel.Application
End Sub
Also failing:-
Code:
Public Sub GetDataFromExcel()
Dim appExcel                As Excel.Application
'*
'** Create a new Excel application.
'*
'  Set appExcel = New Excel.Application
  Set appExcel = CreateObject("Excel.Application")
End Sub
From what I can gather from some posts on various help desk sites, my PC is getting confused because of a Registry entry which may have been left behind by an imperfect uninstall of Office 365. The suggested solution(s) suggest editing the Registry to remove references to parts of Office 365.

I get very nervous using regedit - I subscribe to the old adage "a little knowledge is a dangerous thing".

Can anyone explain in very simple language what to look for to confirm the diagnosis, and how to get around it?

As Office 365 was pre-installed on my new PC (from Aldi), I don't have any installation CDs to uninstall or repair it, so I can't "start over again".

I really need to get my Word project working soon, and without being able to get it to talk to Excel I'd need a major redesign and re-code.

Can any kind soul offer any help?

Thanks in advance....
Reply With Quote
  #2  
Old 09-29-2019, 08:58 AM
sts023 sts023 is offline Opening Excel from Word gets "Automation Error - Library not registered" Windows 10 Opening Excel from Word gets "Automation Error - Library not registered" Office 2010
Hopeless Idiot
Opening Excel from Word gets "Automation Error - Library not registered"
 
Join Date: Apr 2019
Location: God's Own County
Posts: 26
sts023 is on a distinguished road
Default

I stumbled across the answer, so I'm posting it here in case anyone else has a similar problem. In my case I had references under the Excel key (1.7 and 1.9).
I backed up the PC, exported the Registry Key, then deleted the 1.9 key.
Word 2010 now opens Excel 2010 spreadsheets beautifully. Thanks Palisade!

THIS ARTICLE IS BASED ON AN ARTICLE FROM PALISADE SOFTWARE

Removing Outdated References to Office from the System Registry
Removing a version of Microsoft Office can sometimes leave behind "orphan" keys in the System Registry. These references to products which are no longer installed can prevent add-ins from working correctly with Excel, You may see messages such as "Application-defined or object-defined error", "Automation error: Library not registered", "Error in loading DLL", "Could not contact the Microsoft Excel application", "File name or class name not found during Automation operation", or "Object variable or with block variable not set
To remove the outdated references, you will need to edit the System Registry, as detailed below
1. Click Start » Run, type REGEDIT and click OK.
2. Click on Computer at the top of the left-hand panel, then press Ctrl+F to bring up the search window.
Paste the following string including the curly braces {...}, into the search window:
(this is the Key for Excel)
{00020813-0000-0000-C000-000000000046}
3. Check (tick) the Keys box and Match whole string only; clear Values and Data.
4. Click the + sign at the left of {00020813-0000-0000-C000-000000000046} to expand it. You will see one or more subkeys:
1.5 for Excel 2003.
1.6 for Excel 2007.
1.7 for Excel 2010.
1.8 for Excel 2013.
1.9 for Excel 2016.
Identify the one(s) that do not match the version(s) of Excel you actually have installed. If all of them do match installed Excel versions, omit steps 5 and 6.
5. You are about to delete the key(s) that correspond to versions of Microsoft Excel that you do not have. For safety's sake, you may want to back them up first. Right-click on {00020813-0000-0000-C000-000000000046}, select Export, and save the file where you'll be able to find it.
6. Right-click the “1.x” key that does not belong, select Delete, and confirm the deletion. Repeat for each 1.something key that does not belong.
7. The {00020813-0000-0000-C000-000000000046} key can occur in more places. Usually they all have the same subkeys, but not always, so you need to examine each instance. Tap the F3 key to get to each of the others in turn. For each one, repeat steps 4 through 6 (click the + sign, export the key to a new file, and delete the orphaned 1.something entries).

Next, repeat the above process using the Key for Office, which is:-
{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}

The subkeys for Office are
2.3 for Office 2003.
2.4 for Office 2007.
2.5 for Office 2010.
2.6 and 2.7 for Office 2013.
(2.6 and 2.7 are okay for Office 2016 as well, if there is a reference to Office16 under 2.7.)
2.8 for Office 2016.

Your software should now run as normal.
Reply With Quote
Reply

Tags
references, tools

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Word found unreadable content..." + "Word experienced an error trying to open..." onas Word 1 09-02-2019 10:52 AM
Get error:"cannot create page here" when opening a .one file elmer666 OneNote 0 09-20-2017 08:20 AM
Opening Excel from Word gets "Automation Error - Library not registered" Error opening file: "Found a problem with its contents" PoppaDon Word 5 05-03-2016 02:53 PM
Opening Excel from Word gets "Automation Error - Library not registered" Automation error Unknown error" message once they open the Excel file hlina Excel 1 10-08-2013 09:14 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft