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