我有一个excel文件。此excel文件包含一个关于单元格地址的公式(例如A10)。现在我打开这个excel文件。还有一件事,我已经在系统中安装了一个名为汤姆森路透社的插件。通过该插件,小区地址值周期性地改变。如何使用.net (c#)读取更改后的单元格地址值(不保存excel文件)。
发布于 2013-08-29 12:28:59
您只需使用互操作代码打开您的excel文件,这将允许插件代码并排运行。然后,您可以通过互操作调用使用单元格值。
Excel.Application xlApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
xlApp.Visible = true;
Excel.Workbook newWb = xlApp.Workbooks.Open(fileName, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
xlApp.ActiveSheet.get_Range("A10", Type.Missing).Value2;
https://stackoverflow.com/questions/18510862
复制