Excel Charts / VBA
Excel Charts / VBA
(OP)
I want to plot data on an Excel chart using VBA. In Quickbasic there is a "Line" statement that can be used, e.g., Line (10,10)-(20,20). Is there anything similar to this in VBA?
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
|
RE: Excel Charts / VBA
First option you use the ChartObjects collection of the worksheet, second option you use the Shapes collection.
Cheers,
Joerd
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Excel Charts / VBA
If I use ChartObjects with AddLine it says "object does not support this property or method". I am trying to draw lines on a chart using coordinates generated in the Basic program and not in cells.
RE: Excel Charts / VBA
CODE
Set c = ActiveSheet.ChartObjects(1)
Set L = c.Chart.Shapes.AddLine(88., 211., 267., 246.)
Cheers,
Joerd
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.