简体   繁体   中英

Excel Worksheet with C#

I'm updating a chart inside an excel in this way:

ChartObject Chart2 = (ChartObject)mWSheet1.ChartObjects(1);
Chart2.Activate();
Range chartRange2 = mWSheet3.UsedRange;
Chart2.Chart.SetSourceData(chartRange2, Missing.Value);

When I want to print the page mWSheet1 only the chart is printed. How to get back the whole sheet to be printed?

首先不要激活图表,或者在打印之前不要激活图表。

Chart2.Parent.Parent.Cells(1).Activate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM