Hi all,
I am trying to create an excel chart and automate the process.
I have only one column to plot and has close to 360 rows. When I run this piece of the code, I am getting the error "Automation error: Invalid Oleverb Structure"
Can someone help me with this? Google didnt seem to have enough resources.
Thanks in advance.
Workbooks.Open Filename:=Final_Path & "\" & "Dist Users Minute.csv"
n_row = ActiveSheet.Range("B1").Offset(ActiveSheet.Rows.Count - 1, 0).End(xlUp).Row
Set c = ActiveWorkbook.Charts.Add
Set c = c.Location(Where:=xlLocationAsObject, Name:="Dist Users Minute")
With c
.ChartType = xlColumnClustered
.SetSourceData Source:=Sheets("Dist Users Minute").Range("B2:B" & n_row), PlotBy:= _
xlRows
.HasTitle = True
.ChartTitle.Text = "Dist Users Minute"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Hour"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Dist Users"
.HasLegend = False
.Parent.Top = Range("D3").Top
.Parent.Width = Range("D3:M20").Width
.Parent.Height = Range("D3:M20").Height
End With
Bookmarks