locked
Received 80070005 access denied with client machine running Excel 2013 RRS feed

  • Question

  • I have a web page sitting on Windows server 2003. The server has Excel 97 and 2003 and it also has MS Office Access Database Engine 2007 12.0.4518.1031 installed. Microsoft.Office.Core 12 dll is used to access the Excel files. One of its client machines has Excel 2013 running on Windows 7. I downloaded AccessDatabaseEngine.exe. It doesn't work. I am not sure what should I do here. Is there any service pack or anything I can fix this problem? Thanks.   

    cy


    cy

    Friday, June 21, 2013 7:16 PM

All replies

  • Hello,

    Some clarifications with you:

    1. Is this a development (programmatical) issue, or a usage/configuration issue?

    2. What does not work? Could you provide detailed information about this issue?

    Thanks,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, June 25, 2013 12:27 PM
  • Hi Damon,

    I am not quite sure. I thought that the configuration issue is also a part of the development issue.  One of the users added Excel 2013 on his Windows 7 machine recently. The above error message, "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005." was received when the first time he tried to read 2013 Excel on the server using the web page. I don't have 2013 Excel installed on my development machine since we have a limited license. The problem seems to be that the C# code couldn't open 2013 Excel file. 

    The connection string I used in the web page is as the follow.

    strXLSConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
                            strInputFile +
                            ";Extended Properties=\"Excel 12.0;HDR=YES;IMEX=1;\"";

    I tried to find the correct oledb.14. provider to fix the problem. Unfortunately, The one I downloaded it didn't work. I knew there are several possible ways to fix my problem. I can install MS Office Access Database Engine 2007 SP3 in order to let 2007 database engine talking to 2013 Excel. As I mentioned before, I had a problem to install 2007 database engine SP3. Or, I can uninstall 2007 database engine then install the full package of Office 2010 on the server. I would appreciate if you can tell me what I should do. Thanks.

    cy   

     


    cy

    Tuesday, June 25, 2013 6:56 PM
  • Hello,

    Thanks for coming back and providing additional information.

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated. Sorry for any inconvenience and have a nice day!


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 26, 2013 5:57 AM
  • Hi Cy

    I am a bit confused so I want to make sure I have this correct.

    • You have a web page on a server that calls the 2007 Access Connectivity Engine (ACE) to read Excel files.
    • On the server you also have Excel 97 and Excel 2003 installed.
    • This is working fine via a browser from all client machines except one where Excel 2013 was recently installed.
    • When you display this web page in a browser on this one machine and attempt to open an Excel file you get the error: "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005." on the server?

    You also asked about install MS Office Access Database Engine 2007 SP3 in order read the 2013 Excel file or uninstall 2007 database engine then install the full package of Office 2010 on the server.

    To get a better idea of the scope of this case so I can better help you, please answer the following questions:

    • Does this happen every time you try to read the Excel file from the web page on this client?
    • Is the Excel file stored that you are trying to read stored on the client machine, the server or somewhere else?
    • Is the Excel file open in the client when you try to read it from the web page?
    • If you close Excel on the client (even if the file was not open) do you have the same issue?
    • If you try to open this same Excel file from a different client do you have the same issue?
    • Do you see the same issue on this client with other Excel files, specifically files that work from other machine?
      What is the file extension of the Excel file you are trying to read?
    • Is the web page also trying to automate the instance of Excel on the client?

    The first item I want to point out is that file format for Excel has not changed between 2007 and 2013, so installing updates or a newer engine is not needed, but there is a small chance that the issue you are seeing has been resolved in a later version of ACE.

    That being said I want to point out that, as described in KB 257757, we do not recommend or support the server-side automating Office, and, as mentioned on the download page for the ACE drivers, ACE is not intended to be used within a web application.

    Per KB 257757
    Note In this context, the Microsoft 2007 Office System Driver and the 2010 Access Database Engine are considered Microsoft Office components. The term "server-side" also applies to code that is running on a Windows workstation, if the code is running from a Windows workstation other than the interactive station of the user who is logged on. For example, code that is started by Task Scheduler under the SYSTEM account runs in the same environment as "server-side" ASP code or as DCOM code. Therefore, many of the issues that this article describes may occur. For more information about Windows workstations and about COM, see the "More Information" section and the "References" section.
      
    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    The only supported options I know of at this time is to use the 32-bit Jet drivers (which this limits you to reading office documents in the 2003 and earlier file formats) or to use Open XML.

    You can find more information on using Open XML in the "Alternatives to server-side Automation" section of the KB 257757

    More Information:
    =========================
    2007 Office System Driver: Data Connectivity Components
    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7554f536-8c28-4598-9b72-ef94e038c891

    Microsoft Access Database Engine 2010 Redistributable
    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d

    Considerations for server-side Automation of Office
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;257757

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Wednesday, June 26, 2013 6:16 PM
  • Hi Donald,

    • You have a web page on a server that calls the 2007 Access Connectivity Engine (ACE) to read Excel files.
    • On the server you also have Excel 97 and Excel 2003 installed.
    • This is working fine via a browser from all client machines except one where Excel 2013 was recently installed.
    • When you display this web page in a browser on this one machine and attempt to open an Excel file you get the error: "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005." on the server?

    in IE9 on the client.

    The rest of statements are correct.

    please answer the following questions:

    • Does this happen every time you try to read the Excel file from the web page on this client?

    It happens every time.

    • Is the Excel file stored that you are trying to read stored on the client machine, the server or somewhere else?

    on the same server.

    • Is the Excel file open in the client when you try to read it from the web page?

    It doesn’t show the content of Excel in the browser. In my code, I read the Excel file then update the associated table in Oracle.

    • If you close Excel on the client (even if the file was not open) do you have the same issue?

    NA

    • If you try to open this same Excel file from a different client do you have the same issue?

    It happens on one machine which has 2013 Excel installed.

    • Do you see the same issue on this client with other Excel files, specifically files that work from other machine?  They only work on this particular excel file. The Excel file was generated in my code and stored on the server with xls file extension. I believe that they made some modifications and saved it in xls. As I knew, they/the users all had a problem to open it manually before I get involved. They can open it now after they saved the Excel file in .xls format on the server.
    • What is the file extension of the Excel file you are trying to read? xls
    • Is the web page also trying to automate the instance of Excel on the client?

    No. I read the Excel file then update the associated table in Oracle.

    The purpose of this web page is just used to let the user to provide the name of the Excel file and the path. Two controls are used in this web page, one HTML input file browse button and one asp.net push button. This is not an automation job.

    “The only supported options I know of at this time is to use the 32-bit Jet drivers (which this limits you to reading office documents in the 2003 and earlier file formats) or to use Open XML.

    I am not sure you understand what you are talking about.

    I changed the OLEDB provider from JET.OLEDB to ACE.OLEDB in my connection string because I had a problem using JET.OLEDB to read the Excel file. Open XML? will not be adapted in this case.


    cy

    Wednesday, June 26, 2013 8:06 PM
  • Hi Donald,

    I read the article from kb257757 after I replied your questions. Now, I understood why you mentioned about some automation jobs. Have you done the search on the error message I provided? Cut and paste "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005". The article from kb257757 is the first one if you do the search using Google. I thought that 80070005 just means access denied no matter what.

    Sorry. It is not my case.

    I also found out. Maybe, The second message on the search page is the solution of my problem. http://social.msdn.microsoft.com/Forums/en-US/b6388275-b295-4e55-8c25-6d8788eac1ca/error-while-creating-excel-object . I will let you know. Thanks.   


    cy

    Wednesday, June 26, 2013 8:50 PM
  • Hi Cy,

    I want to point out that other post you referenced is also automating Excel with the following code:

    Private ExcelObj As Excel.Application
    ExcelObj = New Excel.Application()

    If you are doing this in a script in your web page that runs on the client it would try to launch the version of Excel on the client which would then make sense why you are getting the error only on a machine with Excel 2013.

    If this is running client side and not server side, I would check if Office 2013 was installed using the "click to run" option instead of via an MSI.

    If that is the case, then I suspect the problem is that Excel is (for lack of a better description) installed in a sandbox on the machine which means your code can't find it.

    Unfortunately the only "solution" I know of would be to uninstall Office 2013 and install it using the traditional MSI method instead of using "click to run".

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, June 28, 2013 12:52 AM
  • Hi Donald,

    Thank you for your information and I don't have the automate script in the web page at all. From what you said, I just want to make sure.

    1. You are saying that I don't need to change the permission in DCOMCNFG.

    2. I don't need ACE.OLEDB.14 or 64 bit ACE.OLEDB to let my code talking to 2013 Excel.

    3. It should fix the problem if I install Office 2013 correctly using MSI.

    I am waiting for the additional license. I will let you know if they are the case.

    Thanks.


    cy

    Friday, June 28, 2013 2:19 PM
  • Hi Cy

    To clarify:

    • To read the Excel 2007-2013 file formats (.xlsx, .xlsm, etc.) you need to use either the ACE drivers or OpenXML.
    • 64-bit versions of the ACE drivers are only available for Office 2010 and Office 2013.
    • In this context, the Microsoft 2007 Office System Driver and the 2010 Access Database Engine are considered Microsoft Office components and Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    Because you are trying to read the Excel file from a web page via C# code which appears to be running on the server, the only supported options are to use Jet, which only support the Excel 2003 and earlier files formats (.xls) or OpenXML. Given that you need to read the new Office 2007-2013 file formats, which prevents you from using Jet, the ONLY supported option is OpenXML.

    Even though you may be able to resolve the issue by changing permissions in DCOMCNFG or repairing/reinstalling Office and/or ACE on the Server, calling Office/ACE from a web page is not supported by Microsoft.

    Best Regards,

    Donald M.
    Microsoft Online Community Support
    --------------------------------------------------------------------------------
    Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, July 9, 2013 3:14 PM