I don't have access to my code that does this. It is at work and I'm not
planning to be back in my office for at least a week.
My code found the the chart area (left, top, width height) in pixels. I
then scaled the x-axis to find the point where to drop the line,
If your x-axis goes from 200 to 300 and you want to drop a line at 225 then
the x pixel is the following
left + [(225 - 200)/(300-200)]*width
Your Y length of the line you have to rememer to multiply by -1. The sceen
pixels start at (0,0) which is the upper left corner of the window. Positive
x dimension goes from left to right. Positive Y direction goes from top of
the screen to bottom of the screen. The graph (0,0) is in the bottom left
corner of the screen. So the height of the graph is in the opposite
direction from the pixel coordinates.
Good luck. I have a macro that drops 3 lines on each graph where the time
scale of the x-axis is different for each graph. I even made each vertical
line a different color. I had excel automatically generate the graph and
then changed the dimensions of the x-axis using a macro. Finally after the
graph was scaled to to my requirements I dropped the 3 lines a specific
locations.