Currently, I have the following code which creates charts within excel:
I want to modify the code so that the charts are not created in Sheet1, but in a Word file. I want to open a blank new word file and create all three graphs there.
Any suggestions?
Thanks!
Code:
With Sheet1.ChartObjects.Add(Left:=390, Width:=375, Top:=25, Height:=225)
.chart.SetSourceData Source:=Sheet22.Range("A1:L2")
.chart.ChartType = xlColumnClustered
.chart.ChartTitle.Characters.Text = "REVERB1 Downtime " & StartDate & "-" & EndDate
.chart.SetElement (msoElementPrimaryValueAxisTitleRotated)
.chart.Axes(xlValue, xlPrimary).AxisTitle.Text = "Total Minutes"
.chart.Legend.delete
End With
With Sheet1.ChartObjects.Add(Left:=775, Width:=375, Top:=25, Height:=225)
.chart.SetSourceData Source:=Sheet22.Range("A3:L4")
.chart.ChartType = xlColumnClustered
.chart.ChartTitle.Characters.Text = "REVERB2 Downtime " & StartDate & "-" & EndDate
.chart.SetElement (msoElementPrimaryValueAxisTitleRotated)
.chart.Axes(xlValue, xlPrimary).AxisTitle.Text = "Total Minutes"
.chart.Legend.delete
End With
With Sheet1.ChartObjects.Add(Left:=390, Width:=375, Top:=260, Height:=225)
.chart.SetSourceData Source:=Sheet22.Range("A5:L6,A8:L8")
.chart.ChartType = xlColumnClustered
.chart.SetElement (msoElementPrimaryValueAxisTitleRotated)
.chart.Axes(xlValue, xlPrimary).AxisTitle.Text = "Total Minutes"
.chart.HasTitle = True
.chart.ChartTitle.Characters.Text = "REVERBs Downtime " & StartDate & "-" & EndDate
End With
I want to modify the code so that the charts are not created in Sheet1, but in a Word file. I want to open a blank new word file and create all three graphs there.
Any suggestions?
Thanks!