Background:
I toasted my old hard drive at work and am getting a new one. With that I'll have to rebuild my machine. My manager has Windows 7 installed on him loaner laptop that I've been using while my machine is out of commision. But I've run into a problem.
We have a fair number of apps that make use of the Microsoft.Office.Interop.Excel reference. I've gotten past a few errors so far but the one I've been stuck on for the last few days (my machine actually suffered the hard drive failure after the first rebuild) and have been unnable to find a fix. I have searched for this error but can't find anyone having this problem on Windows 7, although I have tried other fixes for Windows Server 2008 to no avail.
If I can't fix this problem, I will not be able to use Windows 7 and would like to know that before I rebuild a machine only to have to wipe it and start again (for the third time).
Problem:
OS: Windows 7 Enterprise
Error Message: Exception from HRESULT: 0x800A03EC
Code:
Private m_xls As Microsoft.Office.Interop.Excel.Application
Private m_wkbk As Microsoft.Office.Interop.Excel.Workbook
Private m_wksht As Microsoft.Office.Interop.Excel.Worksheet
m_xls = New Application
m_xls.Visible = False : m_xls.DisplayAlerts = False
m_wkbk = m_xls.Workbooks.Open(Me.FilePath)
m_wksht = CType(m_wkbk.ActiveSheet, Worksheet)
...Write some data...
m_wkbk.SaveAs(Me.FilePath, XlFileFormat.xlWorkbookNormal, Missing.Value, Missing.Value, False, False, XlSaveAsAccessMode.xlNoChange, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value)
The error occurs on the final line.
What I've tried so far:
- Changing the AppPool to use the NetworkService account (it was 'ApplicationPoolIdentity' which I couldn't find in the user list in security settings). Then giving the NetworkService account full access to the appropriate folder.
- Giving NetworkService access to all 'Microsoft Excel Application' settings in DCOMCNFG
- Running this command "appcmd set config -section:asp -enableParentPaths:true" because it's the only other thing I could find
- Using the .SaveCopyAs() which worked but caused different errors
I just wanted to see if anyone else has run into this or not since Windows 7 is new. I can go with Server 2008 but I would like to have some solid reasoning behind it before I tell my manager it won't work.
Thank you, Jeff