使用VB2010查看Excel 2003图表
我试图获取一个图表(在它自己的“工作表”上,而不是作为另一个“工作表”内的对象),并将其显示在 VB2010 Windows 窗体上。
我唯一能找到的是使用代码创建图表,然后从 Excel 加载数据系列。 IE。 Chart1.ChartType = "XYscatter" 或类似的东西,我什至还没有让它正常工作。
我有很多图表可以浏览并手动将它们设置为应有的方式。有没有一种简单的方法可以仅使用 Imports Microsoft.Office.Interop 来执行以下操作
Chart1 = xlWorkBook.Charts("MyChart")
?
I am trying to take a chart(on it's own "sheet", not as an object inside of another "sheet"), and display it on a VB2010 windows form.
The only thing I could find was creating the chart using code, and then loading in the data series from excel. ie. Chart1.ChartType = "XYscatter" or something along those lines, and I haven't even gotten that to work right.
I have way to many charts to go through and manually set them to the way they should be. Is there an easy way to just use Imports Microsoft.Office.Interop to do something along the lines of
Chart1 = xlWorkBook.Charts("MyChart")
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的位置正确,如果您对使用代码创建图表有具体疑问,请发布您所得到的内容,我会看看是否可以提供帮助。
如果您想在 .Net 表单上显示图表,这可能是最好的选择要拍摄图表图像并将其放在表单上,
请获取图表对象:
将其立即复制
到剪贴板上。您应该能够在您认为合适的情况下从 .Net 中进行访问
要证明它在那里,您可以将其粘贴到普通的 Excel 工作表中
Your are on the right line, if you have specific questions about creating a chart with code, post what you've got and i'll see if i can help
If you want to display the chart on a .Net form it might be best to take an image of the chart and put that on the form
get a chart object:
copy it
its now on the clipboard. you should be able to access from there in .Net as you see fit
To prove its there, you can paste it into a normal excel worksheet