1
在Excel 2016中,有一个选项(图表上的右键单击线)>格式化数据系列>平滑线,使2D线图上的线条平滑。通过Visual Basic 6创建Excel图表时,有什么方法可以启用此选项?在Visual Basic 6中的Excel - 如何用平滑线创建图表?
这link文件,为应用程序在Visual Basic中的选项,但我还没有发现任何针对Visual Basic 6:https://msdn.microsoft.com/en-us/library/office/ff195315(v=office.14).aspx
这是我在Visual Basic 6创建图表代码:
Dim xlApp As excel.Application
Set xlApp = New excel.Application
Dim xlWkb As excel.Workbook
Set xlWkb = xlApp.Workbooks.Open("D:\Documents\Book1.xlsx")
Dim xlSht As excel.Worksheet
Set xlSht = xlWkb.Worksheets(1)
Dim xlChart As excel.Chart
Set xlChart = xlWkb.Charts.Add
xlChart.ChartType = xlLine
xlChart.SetSourceData xlSht.Range("A1:B5"), xlColumns
xlChart.Visible = xlSheetVisible
xlChart.Legend.Clear
xlChart.ChartArea.Font.Size = 15
xlChart.ChartArea.Font.Color = vbRed
xlChart.ChartArea.Select
xlChart.ChartArea.Copy
Image1.Picture = Clipboard.GetData(vbCFBitmap) ' Image1 is an image control already placed on the Form.
谢谢,工作完美! – spider93286