I have a web application that create an access database. When I want to create this database, I add Microsoft.Office.Interpob.access.dao.dll from COM references.
This application work in my pc very well. But when I put this application in the customer server I get this error:
Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154
Note that the Microsoft Office Access is not install in customer server. Must I Install this program on this server or can I add some dll to resolve this problem or I have to do anything else?
Thanks.
Check out these links, they might help:
social.msdn.microsoft.com - "Error 80040154 retreiving COM Class factory"
asp.net - "Retrieving COM class factory failed due to the following error: 80040154"
software602.com - "KB987: Error code 80040154. Class not registered"
I know this is a little late for the the original poster, but hopefully this will be useful to others. The correct answer is:
No, you don't need to install Microsoft Office Access on the server.
But, you do need to install the Microsoft Office Access Runtime on the server. From my limited experience it doesn't seem to matter which office runtime - I had the 2013 runtime installed locally but when I installed the runtime on my server it was fine with the 2016 runtime (so both installed the required COM object). In my case I was installing the x64 version.
The Microsoft Office Access Runtime is free from Microsoft.
The Microsoft Access 2013 Runtime can be downloaded from: https://www.microsoft.com/en-gb/download/details.aspx?id=39358
The Microsoft Access 2016 Runtime can be downloaded from https://www.microsoft.com/en-gb/download/details.aspx?id=50040
Related
I'm trying to add a reference to 'Microsoft Outlook 16.0 Object Library' in a C# .NET 4.6.1 WPF project, because I have office 2016 installed. Previous versions of the Object Library are incompatible with the 2016 version of office.
If I use Excel's VBA editor, 'Microsoft Outlook 16.0 Object Library' is listed, and exists in C:\Program Files\WindowsApps\Microsoft.Office.Desktop_16010.9126.2116.0_x86_8wekyb3d8bbwe\VFS\ProgramFilesCommonX86\Microsoft Shared\OFFICE16\MSOUTL.OLB, as you can see below:
However, when I use Visual Studio, the COM tab does not list 'Microsoft Office 16.0 Object Library', and when I try to browse to C:\Program Files\WindowsApps, i get 'You dont currently have permission to access this folder', and clicking 'Continue' (to get access) results in 'You have been denied permission to access this folder'.
So basically, the Office 2016 dlls seem to have been tucked away in a folder that is inaccessible to man, dog, and local administrator.
All I'm trying to do is connect to the open Outlook application, and then send an email with an attachment, so perhaps another question to ask is, is there some new fangled way to communicate with Outlook 2016 that hasn't cropped up in my Googleathon?
Also worth noting is that my version of office is installed as a 'Windows Store Application' and therefore does not appear on the usual Add/Remove programs list, so I can't find any 'repair' options for the installation.
Thanks.
Further investigation reveals that I am doing the right thing - trying to add a COM reference to 'Microsoft Outlook 16.0 Object Library' is now the correct way to target Outlook ... https://stackoverflow.com/a/21018418/5040941.
I've checked the GAC, and the assemblies aren't registered. I've done a repair via the 'Apps and Features' right-click start menu option, and they still aren't appearing - it's as if the Windows Store apps just shove their dlls into the Program Files\WindowsApps\* folder, and don't bother to register them in the GAC.
In answer to the much appreciated comments!
Using the following code
Outlook.Application application = (Outlook.Application)Marshal.GetActiveObject("Outlook.Application");
If I use the nuget Microsoft.Office.Interop.Outlook package, i get a System.Runtime.InteropServices.COMException: 'Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))' exception.
If I try using Microsoft Outlook 15.0 Object Library or Microsoft Outlook 14.0 Object Library references via the Assemblies/Extensions tab of Add Reference, I get a System.Runtime.InteropServices.COMException: 'Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))' exception.
I don't think accessing the WindowsApps folder is the way to go.
Firstly, it's locked down for some reason which typically indicates the potential for trouble if i start digging around and changing security permissions, not to mention the fact that maintaining a copy of the latest dll in my solution will undoubtedly add unnecessary complexity to my project.
Secondly, but more importantly, if I have office installed, and I can access 'Microsoft Outlook 16.0 Object Library' from Excel Vba, then why can't I access it from Visual Studio?
There is obviously some issue with the installation not registering the dlls properly, only Excel has some trick it uses to make the reference available anyway.
Has anyone reading this managed to install Office 365/2016 Windows Store and found a reference to 'Microsoft Outlook 16.0 Object Library' in Visual Studio?
Am I the only with this problem?! Because it affects multiple computers in my office running Windows 10 and Office 365 ...
In answer to RogerN (thanks), please see the image below - I don't have Microsoft.Office.Interop.Outlook version 16 listed, and Microsoft.Office.Core isn't listed either.
If I try to use the v15 library, I get the following error:
System.Runtime.InteropServices.COMException
HResult=0x80040154
Message=Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Source=mscorlib
*AND THE ANSWER IS *
The two computers I bought from Dell are 64 bit, but they come preinstalled with 32 bit, windows store versions of MS Office 2016/365.
In order to fix the problem, I had to:
uninstall the store app from Settings > Apps > Apps&Features > Microsoft Office Desktop Apps > Uninstall
log into portal.office.com
select install office apps, advanced, choosing the 64-bit version
Quite why Dell think we want 32 bit versions installed on 64 bit machines, or why someone from Microsoft hasn't posted a solution to this problem, is beyond my understanding, but nevertheless, RogerN was correct. Thanks to everyone for taking time out their days to help me out.
Elaborating on my earlier comment: From what you've described, it sounds like you've installed a 32-bit version of Microsoft Office on a 64-bit machine. Only 32-bit COM objects would have been registered, and therefore a 64-bit .NET application would be unable to find them. If you search your registry, you ought to find that the 0006F03A-0000-0000-C000-000000000046 class ID is only registered under the Wow6432Node.
To resolve the issue, you could either install the 64-bit version of Office or force your .NET application to target the x86 platform.
I have a website using asp.net with Excel 2010 Interop 64-bit (Microsoft.Office.Interop.Excel.dll).
I deployed code to the Windows Server 64 bit.
By using command:
xelApp = new Microsoft.Office.Interop.Excel.Application();
I see there is no error on this own server.
But from the other computer (same domain), sometimes (not always), I got the error:
System.Runtime.InteropServices.COMException (0x8000401A): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 8000401a.
How could I fix this issue?
By install the Office 2010 64-bit to server 64-bit, I cannot see the Excel in DCOM config.
Please advise.
Thanks.
Check the folowing:
Is Microsoft Office Installed on the server? If not, you may install the MS Office and this feature should be working.
If you do not want to install the MS Office, you can use a similar tool, which is ClosedXML - 1 https://closedxml.codeplex.com/
I recommend to replace the Interop Excel with the ClosedXML.
That error code occurs due to security issues like insufficient privelage or due to incorrect username, password.
I have developped an asp.net application using microsoft office interop excel on my local machine, everything worked well, an excel file was build.
When I deploy the application on my server and run it, I am getting the following exception :
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
failed due to the following error: 80040154 Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
I have done some research on forums, I know that it's probably because excel is missing on the server, however I am not able to find an appropriate solution, knowing that install excel on the server is not really possible. And also knowing that I would like to keep interop as my library.
Does anyone have a solution?
First, what ever you are trying to do, try to do it without using Excel (or any Office) interop in ASP.NET. Microsoft strongly discourages it, as it might not work as you expect.
There are plenty possibilities to do this without the 'client application' Excel, for example EPPlus.
Second, the problem with your code is the lack of Office installed or the wrong version of Office (also consider 32- or 64-bit platform versions).
I'm having a problem with running an application I made on another computer. This is the error message I'm getting:
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154
I searched it on Google, and found out that it means that I need to register that specific component in regedit, but I don't know how to do it, or where to find that component, so please help me.
I used C# in VS 2010 to make my application. One more thing, I don't know if it matters - I installed this application on 3 different computers, and this is the only one that gives me that error - it is a HP all-in-One computer.
for component with CLSID {00024500-0000-0000-C000-000000000046}
That's the guid for Microsoft Excel's Application class. Two very basic reasons you'll get this error:
Microsoft Office is not installed on that machine
The machine has a 64-bit operating system and you installed the 32-bit version of Office. You have to force your program to run in 32-bit mode. Project + Properties, Build tab, change the Platform target setting to x86
The machine has a 64-bit operating system and you installed the 64-bit version of Office 2010. Same fix as above but now you have to make sure to select the AnyCPU target.
i have a web service that reads data from excel using Microsoft.Office.Interop.Excel. It works fine on my local machine but when i upload it on a server it gives the following error
Server was unable to process request. ---> Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.
i googled and tried to follow the suggestion of DCOMCNFG-> component services-> computers-> my computer-> com+ appications but then i dont find the Microsoft excel to change rights.
Office 2003 is installed in server and file i am trying to open is 2003 too.
Please help!!
Thanks
You won't find Excel, you'll have to find the matching CLSID and alter the Activation/Launch permissions.
Standard Disclaimer: Unattended execution of office on the server is not recommended by Microsoft, but a lot of us do it happily (myself included).