我有一个我为Excel制作的功能区以及一个cs文件作为加载项的核心.在CustomRibbon上单击按钮时,我想解析其中一行的数据值.
private void button1_Click(object sender, RibbonControlEventArgs e)
{
Console.WriteLine(Globals.ThisAddIn.Application.Cells[0, 0]);
}
Run Code Online (Sandbox Code Playgroud)
但这给了我一个错误
来自HRESULT的异常:0x800A03EC
我想要做的就是能够解析工作表上的单元格中的数据并将数据写入工作表.即使在我的程序启动时,我也这样做:
sheet.Cells[0,0]= "hello";
Run Code Online (Sandbox Code Playgroud)
它也给我一个错误.