Mfc基于对话框的excel文件应用程序图 [英] Mfc Dialogbased application plot graph for excel file
问题描述
我使用此链接作为参考。
自动化Excel 2007并在Visual Studio 2008中使用C ++ MFC应用程序创建图表 [ ^ ]
但是在这个项目中,excel单元格值是使用range.put_value2进行硬编码的
range = sheet.get_Range(COleVariant(TEXT(C3)),COleVariant(TEXT(C3)));
range.put_Value2(COleVariant(short) (30)));
我想为excel文件绘制图表。我选择哪个文件它应绘制该excel文件数据的图形。我不想硬编码数据我怎么能这样做?
谢谢。
Hi ,
I have use this link for reference.
Automating Excel 2007 and creating charts using C++ MFC application in Visual Studio 2008[^]
But in this project excel cell values are hard coded by using range.put_value2
range = sheet.get_Range(COleVariant(TEXT("C3")),COleVariant(TEXT("C3")));
range.put_Value2(COleVariant(short(30)));
I want to plot graph for excel files. whichever file I choose It should plot the graph for that excel file data. I don't want to hardcode the data How i can do it?
Thank you.
推荐答案
创建 COleVariant 及其值将代码应用于代码中
Create instances of the COleVariant with your values an apply them in the code
CString myCell = TEXT("C3");//or any other
range = sheet.get_Range(COleVariant(myCell),COleVariant(myCell));
这篇关于Mfc基于对话框的excel文件应用程序图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!