简体   繁体   English

当单元格打开并且单元格包含公式时,如何读取和优化单元格地址

[英]How to read and excel cell address, when it is open and cell contains a formula

I have an excel file. 我有一个Excel文件。 This excel file contains a formula on a cell address(example A10). 此excel文件包含有关单元格地址的公式(示例A10)。 Now i open this excel file. 现在我打开这个excel文件。 One more thing I have installed an Add-Ins named Thomson Reuters in system. 我还安装了一个名为Thomson Reuters的加载项。 Through this Add-Ins cell address value changed periodically. 通过此外接程序单元地址值定期更改。 How can i read the changed cell address value (without saving the excel file) using .net (c#). 如何使用.net(c#)读取更改的单元格地址值(不保存excel文件)。

You Just open your excel file using interop code this will allow addin code to run side by side. 您只需使用互操作代码打开excel文件,这将允许插件代码并排运行。 then you can use cell value using interop calls. 那么您可以通过互操作调用使用单元格值。

    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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM