I'm having trouble, trying to write an Excel Formula in a .xmlx file. The weird part is that with the first Formula in the code segment below it runs perfectly fine. (The Formula is correct, just in German).
With the second im getting the Error Code HRESULT: 0x800A03EC. The Formula is not the Problem since it works when i copy it manually in the Sheet.
I've tried the possibly difficult characters, also not the Problem.
The Complete Exception:
Ein Ausnahmefehler des Typs "System.Runtime.InteropServices.COMException" ist in mscorlib.dll aufgetreten.
Zus?tzliche Informationen: Ausnahme von HRESULT: 0x800A03EC
//string vFormel = "=SUMME(N4+O4+P4+Q4+R4)/S4";
string vFormel = "=SUMME(WENN(N4 = "-";0;N4)+WENN(O4 = "-";0;O4)+WENN(P4 = "-";0;P4)+WENN(Q4 = "-";0;Q4)+WENN(R4 = "-";0;R4))";
try
{
vSheet.Range["T4"].Formula = vFormel;
vSheet.Range["T4", "T56"].FillDown();
}
catch (Exception ex)
{
vWorkbook.Close(false);
ExcelApp.Quit();
throw ex;
}
question from:
https://stackoverflow.com/questions/65909778/c-sharp-excel-interlop-error-hresult-0x800a03ec-with-some-formula-not-all 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…