Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
282 views
in Technique[技术] by (71.8m points)

C# Excel Interlop Error HRESULT: 0x800A03EC with some Formula, not all

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...