|
按照下面的方法无法在独立窗口中显示(样式见图片),请高手指教!
Sub 创建嵌入图表()
Dim cht As ChartObject
On Error Resume Next
ActiveSheet.ChartObjects.Delete
On Error GoTo 0
Set cht = ActiveSheet.ChartObjects.Add(50, 50, 400, 250)
With cht
.Name = "Results"
With .Chart
.SetSourceData Source:=Sheets("成绩表").Range("B2:E7"), PlotBy:=xlRows
.ChartType = xlColumnClustered
.SetElement msoElementChartTitleCenteredOverlay
.ChartTitle.Text = "成绩分析图"
End With
End With
cht.Chart.ShowWindow = True
With ActiveWindow
.WindowState = xlNormal
.Top = 50
.Left = 50
.Width = 500
.Height = 350
.Caption = ThisWorkbook.Name
End With
End Sub
|
|