I'm trying to rotate a line shape (created with the Shapes.AddLine method) about a point.
I've found an example authored by Chip Pearson - a clock - that does this nicely. It uses the following code to move the second hand:
Private Sub SetSecondHand(Seconds As Single)
Dim Theta As Single ' clockwise angle from vertical
Dim NewX As Single
Dim NewY As Single
Dim LS as Shape
Theta = (Seconds / 60) * TwoPI
NewX = cCenterX + (cLenSecond * Sin(Theta))
NewY = cCenterY - (cLenSecond * Cos(Theta))
LS.Nodes.SetPosition 2, NewX, NewY
However, when I try to run this code in Excel 2010, it returns the following error message:
"The specified value is out of range"
(Variables NewX = 296 and NewY = 107)
I've attached the original source file. Can you assist me in getting this to work on the newer version of Excel? Clock.xls