如何从excel中获取隐藏的公式 [英] How to get the hidden formulas from an excel

查看:252
本文介绍了如何从excel中获取隐藏的公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在创建一个应用程序来获取excel中写入的数据。但与此同时,我想从已经创建的excel中获取隐藏的公式。有人可以指导我如何使用它。我的意思是有没有特定的lib可以帮助我获得这些或有任何方法可以做到这一点。



我打算用VC ++或C#来编写它可以在一个窗口平台上工作。请指导我构建这个应用程序。





先谢谢。



我尝试了什么:



我已经有了一个从pdf获取数据的应用程序,文本和doc文件。现在我想创建新的或添加此功能到现有的,但我还没有尝试任何关于excel文件。

Hi,

I am creating an application to get the data written in the excel. But along with this i would like to get the hidden formula from the excel which have been already created. Can someone guide me how would i go with this. I mean are there any specific lib which will help me to get those or is there any way to do it.

I am planning this to write either in VC++ or C# which works in a window platform.Please guide me in building this application.


Thanks in Advance.

What I have tried:

I already have an application to get the data from the pdf,text and doc files. Now i would like to create new or add this functionality to the existing, but I haven't tried anything with regards to excel files.

推荐答案

看看这个



如何使用c#访问excel表中的公式? - 堆栈溢出 [ ^ ]


单元格的值可以是公式。在你的excel互操作代码中尝试这个(假设你有excel互操作代码):



The cell's value can be a formula. Try this in your excel interop code (assuming you have excel interop code):

string value = (string)(workbook.ActiveSheet.Cells[row, col].Value2);


如果我理解正确



1.选择单元格或范围包含公式的单元格。

2.选择格式 - 单元格以显示单元格格式对话框。 (或者,使用键盘上的Ctrl + 1。)

3.选择保护选项卡上的隐藏和锁定复选框。

4.单击确定。

5.选择工具 - 保护 - 保护工作表以显示保护工作表对话框。

6.确保选中保护工作表和锁定单元格的内容复选框。 $>
7.在取消保护密码的密码文本框中键入保护工作表的密码。

8.单击确定。 Excel将显示确认密码对话框。

9.再次键入密码,然后单击确定。
If I understand you correctly

1. Select the cell or range of cells that contain the formulas.
2. Choose Format – Cells to display the Format Cells dialog box. (Alternatively, use Ctrl+1 on the keyboard.)
3. Select the Hidden and Locked check boxes on the Protection tab.
4. Click OK.
5. Choose Tools – Protection – Protect Sheet to display the Protect Sheet dialog box.
6. Make sure that the Protect Worksheet and Contents of Locked Cells check box is selected.
7. Type the password for protecting the worksheet in the Password to Unprotect Sheet text box.
8. Click OK. Excel will display the Confirm Password dialog box.
9. Type the password again, and then click OK.


这篇关于如何从excel中获取隐藏的公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆