none
Microsoft Excel Application entry missing in DCOMCNFG

    Question

  • Hi I'm using windows 7 home premium. I have an application in ASP.Net which uses Excel Application Object. It used to work fine in XP but in Windows 7 I'm getting an error as mentioned below:

    Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

    I need to give permissions to Microsoft Excel Application in DCOM config but I can't seem to find this in windows 7. It used to be there in earlier versions but now its not there. I tried to reinstall Office 2007 but still I couldn't find it in DCOM config. Please suggest where I can give permissions to MS Excel Application so that my application runs without errors.

    Thanks
    Irfan<!-- google_ad_section_end -->
    Wednesday, January 20, 2010 4:14 PM

Answers

  • Solved!

    1. In DCOMCNFG, right click on the My Computer and select properties.
    2. Choose the COM Securities tab
    3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for <Machine_name>\Users.
    4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for <Machine_name>\Users

    Press OK and thats it. i can run my application now.

    • Marked as answer by irfangani Sunday, January 24, 2010 2:39 PM
    Sunday, January 24, 2010 1:41 PM

All replies

  • Hello,

    In windows 7, follow these steps to open DCOM config:
     
    1. Click start button, in start search bar, type in  "DCOMCNFG.EXE" (without quote) and then press enter.
    2. Click Computer->DCOM Config, locate component with CLSID {00024500-0000-0000-C000-000000000046}and modify the permission.

    If the error still happens, try to disable UAC and see if you application can work.


    Thomas77
    Thursday, January 21, 2010 5:40 AM
  • Hi,

    Thanks for your reply. I tried to locate the component with the same Application ID but couldn't find it. I found somewhat similar ID {00021401-0000-0000-C000-000000000046} but not the exact one. Also on clicking properties, in securities tab, the edit buttons are disable. They are disabled even when I open the Component Services in elevated mode. Please suggest what needs to be done.

    Thanks
    Irfan
    Thursday, January 21, 2010 6:54 AM
  • Hello,

    Did you see "Microsoft Excel Application" in DCOMCNFG? If yes, try to modify its Permission. Then modify the Permission of the following registry key:

    HKEY_CLASSES_ROOT\CLSID

    1. Open regedit, locate [HKEY_CLASSES_ROOT\CLSID]. Right click CLSID key and choose Permissions.
    2. Click add, type in Everyone and then then "Allow" "Full control".



    Thomas77
    • Proposed as answer by Mickey Fischer Friday, December 07, 2012 7:15 AM
    Thursday, January 21, 2010 7:29 AM
  • Hi,

    The entry is not there in DCOMCNFG (Neither "Microsoft Excel Application" nor "{00024500-0000-0000-C000-000000000046}"). But in registry I could find the CLSID {00024500-0000-0000-C000-000000000046}. Gave full permission to Everyone on that CLSID. Still I'm getting the same error.

    Irfan
    Thursday, January 21, 2010 11:25 AM
  • Solved!

    1. In DCOMCNFG, right click on the My Computer and select properties.
    2. Choose the COM Securities tab
    3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for <Machine_name>\Users.
    4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for <Machine_name>\Users

    Press OK and thats it. i can run my application now.

    • Marked as answer by irfangani Sunday, January 24, 2010 2:39 PM
    Sunday, January 24, 2010 1:41 PM
  • I'm so frustrated, I have similar issue. My app modifies a .xlsm workbook saves it to a temp file and response.writefile(TempFile) to the user.

     

    I also get the error Microsoft Excel cannot access the file error. I gave permissions like irfangani said. I've checked permissions to the directory & file.

    Nothing!

     

    But it works great on my dev machine.

    Thanks in advance!!

    Here's the code ...

             public string BuildExcelFile(string fileID, ref string err)

            {

                Microsoft.Office.Interop.Excel.Application oXL = null;

                Microsoft.Office.Interop.Excel._Workbook oWB = null;

                Microsoft.Office.Interop.Excel.Worksheet oSheet = null;

                try

                {

                    oXL = new Microsoft.Office.Interop.Excel.Application();

                    oXL.Visible = false;

                    oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Open("c:\\temp\\Exceptions.xlsm"));

                    oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oWB.Sheets["Exceptions"];

     

                    string tempfile;

                    int ID;

     

                    if (int.TryParse(fileID, out ID))

                        oSheet.Cells[1, 3].Value = ID;


                    oWB.Application.Run("Module1.GetExceptionData");

     

     

                    tempfile = GetTempFile();

                    oWB.SaveAs(tempfile, FileFormat: 52);

     

                    // Need all following code to clean up and extingush all references!!!

                    oWB.Close(null, null, null);

                    oXL.Workbooks.Close();

                    oXL.Quit();

                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oXL);

                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oSheet);

                    System.Runtime.InteropServices.Marshal.ReleaseComObject(oWB);

                    oSheet = null;

                    oWB = null;

                    oXL = null;

                    GC.Collect(); // force final cleanup!

     

     

                    return tempfile;

                }

                catch (Exception e)

                {

     

                    err = e.Message;

                    return "";

                }

            }

     

            public string GetTempFile()

            {

                string filename;

     

                filename = "c:\\temp\\excp" + DateTime.Now.TimeOfDay.TotalSeconds.ToString().Replace(".","") + ".xlsm";

     

                return filename;

            }


    Tuesday, July 13, 2010 6:57 PM
  • Can someone plz help me!!!facing the same problem...still no solution.

    Already wasted 2 full days :(. I'm unable to find the entry(Micrsoft Excel Application) in DCOMCNFG. Or how to get the Application Id of Excel. Also when I try to edit the permissions of any entry....its disabled. Some security settings??

     

    HELP!!!!!!

    Wednesday, August 18, 2010 5:34 AM
  • I gave up and went a different direction. I don't know if my solution will help you, but instead of running my query and building the report in server-side Excel. I put the report request in a queue for that user. I Response.Write the Xlsm file out, and when Excel Opens the file I have code in the Open Event that retrieves the request and builds the report on the client side, this way I totally avoid server-side Excel automation.

    Hope that helps.

    Friday, August 27, 2010 2:29 PM
  • On 64 bit system with 32 bit Office try this:
    1. Start
    2. Run
    3. mmc -32
    4. File
    5. Add Remove Snap-in
    6. Component Services
    7. Add
    8. OK
    9. Console Root
    10. Component Services
    11. Computers
    12. My Computer
    13. DCOM Config
    14. Microsoft Excel Application
    15. ...
    ;)
    • Proposed as answer by Ivjay Wednesday, February 09, 2011 5:40 PM
    Wednesday, November 03, 2010 2:38 PM
  • You can start DCOMCNFG in 32-bit mode using:

    DCOMCNFG -32

     

    Tuesday, December 07, 2010 9:55 PM
  • Just press Refresh on Console Root | Component Services | Computers | My Computer | DCOM Config to get Microsoft Excel displayed in the list.
    Tuesday, March 13, 2012 5:52 PM
  • Ivjay you rock, this recommendation added with the fact of setting the application to run on "the interactive user" on the identity portion solved the issue (as describe on http://blogs.msdn.com/b/dataaccesstechnologies/archive/2011/01/22/the-ssis-and-excel-story-continues.aspx).  Finally this simple task is out of my WIP bin.  Thank you all!
    Monday, April 02, 2012 6:39 PM
  • Solved!

    1. In DCOMCNFG, right click on the My Computer and select properties.
    2. Choose the COM Securities tab
    3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for <Machine_name>\Users.
    4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for <Machine_name>\Users

    Press OK and thats it. i can run my application now.

    This Solution worked for me
    Tuesday, July 24, 2012 2:37 PM
  • Ivjay Thanks a lot. Your steps finally worked for me. 

    Thank you so much for your contribution.

    Tuesday, July 24, 2012 2:38 PM
  • On 64 bit system with 32 bit Office try this:
    1. Start
    2. Run
    3. mmc -32
    4. File
    5. Add Remove Snap-in
    6. Component Services
    7. Add
    8. OK
    9. Console Root
    10. Component Services
    11. Computers
    12. My Computer
    13. DCOM Config
    14. Microsoft Excel Application
    15. ...
    ;)
    It worked for me. Thank you so much
    Tuesday, July 24, 2012 2:39 PM
  • This helped me. 

    I found that I only needed to give my IIS AppPool (e.g. "IIS APPPOOL\DefaultAppPool") the "Local Activation" in the "Launch and Activation Permissions".

    Tuesday, July 24, 2012 10:55 PM
  • That's it! Works like charm!

    Tuesday, August 28, 2012 4:40 PM
  • Solved!


    1. In DCOMCNFG, right click on the My Computer and select properties.
    2. Choose the COM Securities tab
    3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for <Machine_name>\Users.
    4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for <Machine_name>\Users

    Press OK and thats it. i can run my application now.

    Hi Irfan,

    Thanks a Ton.

    This one helped me for COM exception while accessing internet explorer.

    Am trying to print a HTML on serverside via WCF+IIS

    For reference :

    http://stackoverflow.com/questions/12423108/shdocvw-internetexplorer-printing-serverside-failing-com-exception

    Regards,

    Pavan N


    Pavan N Kumar


    Saturday, September 15, 2012 9:41 AM
  • Thanks - that is brilliant!

    After wasting a whole day - Why do MS keep introducing crap like this that just makes everyone's lives miserable? Or do they think developers have nothing better to do than wade through all the restrictions they put in their way?

    Tuesday, October 30, 2012 2:28 PM
  • This solution worked for me. Thank you very much.
    Thursday, November 08, 2012 6:26 AM
  • What are the steps 4 and 5. I didn`t get. Please reply.

    ira

    Friday, March 08, 2013 7:54 AM
  • Solved!

    1. In DCOMCNFG, right click on the My Computer and select properties.
    2. Choose the COM Securities tab
    3. In Access Permissions, click "Edit Defaults" and add Network Service to it and give it "Allow local access" permission. Do the same for <Machine_name>\Users.
    4. In launch and Activation Permissions, click "Edit Defaults" and add Network Service to it and give it "Local launch" and "Local Activation" permission. Do the same for <Machine_name>\Users

    Press OK and thats it. i can run my application now.

         Hi irfangani,

      I did the steps but it still does not appear on the Excel.Application component services.
    What else might I need to do?

    e-mail address: newyazilim@hotmail.com
    respects
    Saturday, March 23, 2013 9:29 PM
  • Hi,

    All the above solutions are working, if I am an administrator on the server. If, I remove my administrative access, I am able to download the excel on my application but the file is of 0 bytes.

    Any idea. Please help ASAP.

    Tuesday, July 09, 2013 9:48 AM
  • Thanks guys. This also helped me resolve Excel application issue on my ASP pages. Good work guys.!

    Tuesday, September 10, 2013 4:49 AM
  • Thanks a lot....It saves my time.
    Wednesday, September 18, 2013 10:38 AM
  • Computer Restart Required!!!
    Friday, November 29, 2013 12:07 AM
  • I tried every step on this page. It looks not work. Any suggestion. 

    Very appreciate your help.

    James Wu

    afm11520@yahoo.com


    James in Austin

    Thursday, December 26, 2013 10:20 PM
  • If the account which is running EXCEL is administrator then this will work:

    For 64-bit (x64), create this folder: C:\Windows\SysWOW64\config\systemprofile\Desktop

    For 32-bit (x86), create this folder: C:\Windows\System32\config\systemprofile\Desktop

    Otherwise To resolve this issue follow these steps:

     

    1.        Login to your Server as a administrator
    2.        Go to "Start" -> "Run" and enter "MMC comexp.msc /32"
    3.        Go to the properties of Microsoft Excel Application, under Identity, change it to The Interactive User from The Launching User (which is set by default).
    4.        Go to the properties of Microsoft Office Excel 2007 Workbook, under Identity, change it to The Interactive User from The Launching User (which is set by default).
    5.        Go to Security tab for Microsoft Excel Application and select Customize for

    " Launch and Activation Permissions" and add ACCOUNT (under which EXCEL is running) to it and give it "Local launch" and "Local Activation" permission

    1.        Go to Security tab for Microsoft Office Excel 2007 Workbook and select Customize for

    " Access Permissions " and add ACCOUNT (under which EXCEL is running)  to it and give it "Local Access" permission

    Wednesday, October 29, 2014 9:23 AM
  • Hi

    your direction seems little different, i want to open word document from byte stream from db and open application on the fly without downloading and user should be able to save the document and return the bytes to db,

    i am able to do this in development server but issue arises when hosted in iis, as the same issue others has posted,

    is there any solution as  you have mentioned other than opening word.Application = new Application();

    Thanks

    Aboo

    Thursday, December 18, 2014 12:19 PM
  • Can not see Microsoft Excel Application in DCOM Config.

    Any help??

    Friday, December 19, 2014 9:52 AM