I am getting below error while trying to run an interop dependent program on Windows server 2008 its running fine on Win Server 2003 and XP:
System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
at Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs(.......)
According to Microsoft, Windows Server 2008 is not in list of suppoerted OS.
http://www.microsoft.com/downloads/en/details.aspx?familyid=3c9a983a-ac14-4125-8ba0-d36d67e0f4ad&displaylang=en
System Requirements
Supported Operating Systems:Windows 2000 Service Pack 3;Windows Server 2003;Windows XP
Can anybody please confirm this.. has anyone tried it ..?
Found Answer.......!!!!!!!
Officially Microsoft Office 2003 Interop is not supported on Windows server 2008 by Microsoft.
But after a lot of permutations & combinations with the code and search, we came across one solution which works for our scenario.
The solution is to plug the difference between the way Windows 2003 and 2008 maintains its folder structure, because Office Interop depends on the desktop folder for file open/save intermediately.
The 2003 system houses the desktop folder under systemprofile which is absent in 2008.
So when we create this folder 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...
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..!
.NET 1.1 is also a requirement, which I don't believe is on Windows Server 2008 (and really shouldn't be, just my opinion) which might be your problem.
Well, in general, running interop on any server is usually not a good idea, since Office is not made to be part of a server solution. However, assuming that you can't change that, it should be possible to get it to run, but I have seen a lot of problems having various issues but the solutions seems to be different for different people.
This stackoverflow question has some answers, some of which might help you (it's about Win7, but it should still be relevant I'd think).