使用 Delphi 7 复制 Excel 公式
我的团队领导要我检查一下这是否可行。
我们的应用程序有一个显示一些值的网格(我们使用 tmssoftware 中的 TAdvStringGrid)。然后我们的用户复制并粘贴到 Excel。 (2010) 现在,他们希望在使用 Excel 时自动更新值。换句话说,我需要复制类似于包含值和公式的 Excel 工作表的公式,并将其粘贴到另一张工作表上。
我正在考虑将其导出为带有公式的 Excel 文件(带有某种 Excel 组件),但团队领导首先想看看复制是否有效。
我以前从未使用过 Excel(使用 Delphi)。 :-(
谢谢
My team leader wants me to check if this is possible.
Our app has a grid (we use TAdvStringGrid from tmssoftware) that displays some values. Our users then copy and paste to Excel. (2010) Now they want the values to update automatically when they play with Excel. In other words, I need to copy formulas similar to having a Excel sheet with values and formulas and pasting it on another sheet.
I'm thinking of exporting it as an Excel file (with some kind of excel component) with the formulas but team leader first want to see if the copying will work or not.
I never worked with Excel (using Delphi) before. :-(
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
听起来您需要来自 TAdvSpreadGrid tmssoftware.com/" rel="nofollow noreferrer">TMS 代替。它是 TAdvStringGrid 的增强版本,也支持公式。
如果您需要更多 Excel 支持,他们有 TMS FlexCel Studio,非常好。
Sounds like you need the TAdvSpreadGrid from TMS instead. It's an enchanced version of TAdvStringGrid that has support for the formulas as well.
If you need even more Excel Support they have TMS FlexCel Studio that is very nice.
我也使用 TMS 的 TAdvSpreadGrid。为了阅读和编写真正漂亮的电子表格,支持公式、良好的格式设置,甚至窗格冻结以使我的客户更容易进行数据编辑,我使用 本机 Excel。它速度快,有良好的文档,并且易于使用。值得一看。
I use TAdvSpreadGrid from TMS also. For reading and writing really spiffy spreadsheets with support for formulas, nice formatting and even pane freezing to make data editing easier for my clients, I use Native Excel. It's fast, has good documentation, and is easy to use. It's worth a look.
虽然前面的答案没有错,但我找到了另一个解决方案。
我尝试将计算(例如 =A1+B1)以纯文本形式添加到单元格中。复制到 Excel 时,它接受我的公式作为 Excel 公式并按照我想要的方式进行计算。
无需在 TAdvSpreadGrid 或其他东西上花费更多的钱。 :-)
While the previous answers aren't wrong, I found another solution.
I tried adding the calculation (e.g. =A1+B1) to the cell as plain text. When copying to Excel it accepts my formula as an Excel formula and calculates it just like I want it.
No need to splash out more money on TAdvSpreadGrid or something else. :-)