Axes(xlValue, xlPrimary).AxisTitle.Text = "Power (kW)" Axes(xlValue, xlPrimary).HasTitle = True ![]() ![]() Axes(xlCategory, xlPrimary).AxisTitle.Text = "Time (h)" Axes(xlCategory, xlPrimary).HasTitle = True SetElement (msoElementChartTitleAboveChart) ' If there is a previous chart, delete it Any ideas on whats causing this? Sub CreatingChartOnChartSheet() Continuing to rerun my code repeats the cycle of good plot -> bad plot -> good plot. Then, when I run the code a third time, I get the correct plot once again. ![]() However, when I rerun the code with a "Power Chart" present, I get 3 additional series showing up, two with blank data and one with only y values, corresponding to the last column in my worksheet. when there is no "Power Chart" present), it plots the data correctly. When I run the code shown below for the first time (i.e. ![]() I am trying to create an xy scatter plot on its own worksheet using VBA.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |