调用方法时抛出异常 HRESULT 0x800A03EC

问题描述 投票:0回答:1

应用程序从多个文件生成 Excel 文档并产生以下错误

System.Runtime.InteropServices.COMException HRESULT 0x800A03EC

        public void Off(Excel.Application application)
        {
            application.EnableEvents = true;
            application.Calculation = Excel.XlCalculation.xlCalculationAutomatic; // Error HRESULT 0x800A03EC
            application.DisplayAlerts = true;
            application.DisplayStatusBar = true;
            application.ScreenUpdating = true;
        }

我尝试在互联网上搜索,但没有给出任何结果。

c# excel
1个回答
-1
投票

官方文档说出现这个错误:

“当使用需要指定列的 Excel 操作时, 行或两者,列索引必须大于零且小于 16,385,或者列字母必须属于 A 和 XFD。此外,行索引必须大于零且小于 超过 1,048,577。”

© www.soinside.com 2019 - 2024. All rights reserved.