以编程方式存储数据时,Excel模板会更改 [英] Excel Template changes when data is stored programmatically

查看:85
本文介绍了以编程方式存储数据时,Excel模板会更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

在我正在进行的一个小项目中,我在excel中创建了一个简单的模板,该模板具有一个图表和该图表的一列值.我将其保存为.xlt(Excel模板). (我希望这是正确的方法)

现在基于我的c ++程序中的一些计算,我打开了这个特殊的.xlt文件,并将这些值保存在指定的列中.
但是,当我打开文件时,将打印我的值,但是没有图表.

请需要帮助..

Hello,

In a little project I''m working on, I created a simple template in excel which has a chart and a column of values for the chart. I saved this as .xlt (Excel temple). (I hope that''s the right way)

Now based on some calculations in my c++ program, I opened this particular .xlt file and saved those values, in the column specified.
But when I open the file, my values are printed but there is no chart.

Need some help please..

推荐答案

Excel应用程序中的模板是工作簿的副本.因此,如果您想显示默认值,则模板是个好主意,否则就不行了!

您应该知道excel文件不是简单的文本文件!您不能使用WriteString();方法!

从这里开始:
http://support.microsoft.com/kb/308407 [ http://support.microsoft.com/default.aspx?scid=kb;zh-我们; 178782 [ ^ ]
BasicExcel-可以读写Microsoft Excel的类 [ ^ ]
如何在中读取和写入Excel文件通过ADO的C ++ [ ^ ]
CSpreadSheet-读写Excel的类和文本分隔的电子表格 [ ^ ]

有用的库: http://www.libxl.com/ [
Templates in an Excel application are the copies of workbooks. So, if you would like to display default values, template is a good idea, in other way, it''s not!

You should know that the excel file is not a simple text file! You can''t use WriteString(); method!

Start here:
http://support.microsoft.com/kb/308407[^]
http://support.microsoft.com/default.aspx?scid=kb;en-us;178782[^]
BasicExcel - A Class to Read and Write to Microsoft Excel[^]
How to Read and Write Excel Files in C++ via ADO[^]
CSpreadSheet - A Class to Read and Write to Excel and Text Delimited Spreadsheet[^]

Useful library: http://www.libxl.com/[^]


这篇关于以编程方式存储数据时,Excel模板会更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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