none
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC

    Question

  •  

    Getting following error:

    System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC

    at Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local)

    The Same code is working fine on Windows server 2003 and also on XP but not on Windows server 2008.

    Please help ..!

    Friday, December 10, 2010 10:15 AM

Answers

  • Thanks Bessie

    Found Answer, actually a workaround.......!!!!!!!

    Officially I think Microsoft Office 2003 Interop is not supported on Windows server 2008 by Microsoft (Please Confirm).

    (REF: http://www.microsoft.com/downloads/en/details.aspx?familyid=3c9a983a-ac14-4125-8ba0-d36d67e0f4ad&displaylang=en  )

    But after a lot of permutations & combinations with the code and search, we came across one solution which works for our scenario.

    We need to create some folders on 2008 under the respective hierarchy as indicated below; the office Interop is able to save the file as required. This Desktop folder is required to be created under

    C:\Windows\System32\config\systemprofile

    AND

    C:\Windows\SysWOW64\config\systemprofile

    This worked for me...

    (For people looking for solution: Also do check if .NET 1.1 is installed because its needed by Interop and ot preinstalled by Windows Server 2008

    Or you can also Use SaveCopyas() method ist just take onargument as filename string)

    Thanks Guys..!

    • Marked as answer by samant_sameer Wednesday, December 15, 2010 11:24 AM
    Wednesday, December 15, 2010 11:24 AM

All replies

  • Hello samant,

    Thanks for posting. To provide further assistance, would you mind clarifying some points?

    • What versions of Office and Visual Studio in this Windows Server 2007, XP and Windows Server 2008?
    • Is this project a VSTO add-in, or Excel automation? Would you mind simplify a project and sharing it with us? So that I could try to use it on my side.

    Have you checked this link? It might will give you some useful information.

    I am looking forward to your reply. Have a nice day.


    Bessie Zhao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 13, 2010 6:37 AM
  • Thanks Bessie

    Found Answer, actually a workaround.......!!!!!!!

    Officially I think Microsoft Office 2003 Interop is not supported on Windows server 2008 by Microsoft (Please Confirm).

    (REF: http://www.microsoft.com/downloads/en/details.aspx?familyid=3c9a983a-ac14-4125-8ba0-d36d67e0f4ad&displaylang=en  )

    But after a lot of permutations & combinations with the code and search, we came across one solution which works for our scenario.

    We need to create some folders on 2008 under the respective hierarchy as indicated below; the office Interop is able to save the file as required. This Desktop folder is required to be created under

    C:\Windows\System32\config\systemprofile

    AND

    C:\Windows\SysWOW64\config\systemprofile

    This worked for me...

    (For people looking for solution: Also do check if .NET 1.1 is installed because its needed by Interop and ot preinstalled by Windows Server 2008

    Or you can also Use SaveCopyas() method ist just take onargument as filename string)

    Thanks Guys..!

    • Marked as answer by samant_sameer Wednesday, December 15, 2010 11:24 AM
    Wednesday, December 15, 2010 11:24 AM
  • Hi all

    i'm trying in windows server 2003 and office 2007 still having error.

    System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file ''. There are several possible reasons: • The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook. at Microsoft.Office.Interop.Excel.WorkbookClass.SaveA s(Object Filename, Object FileFormat, Object Password, Object WriteResPassword, Object ReadOnlyRecommended, Object CreateBackup, XlSaveAsAccessMode AccessMode, Object ConflictResolution, Object AddToMru, Object TextCodepage, Object TextVisualLayout, Object Local)

    i'm already give security access into C:\Wibndows\System32\config\systemprofile.

    Any solution for this problem ??

    Thanks

     

     

     

     

    Friday, December 17, 2010 2:35 AM
  • Thanks Samant.  creating the folder in C:\Windows\SysWOW64\config\systemprofile worked for me in win 2008 r2 x64.

    Thanks,

    Raghav


    Raghav

    Friday, April 13, 2012 2:00 AM