Runtime error 5

rintelen

Board Regular
Joined
Jul 30, 2006
Messages
96
this is a routine which makes a pointer turn around according to what angle is set by the user.
When it goes to run it comes up with a runtime error 5. It used to work a few years ago but now it comes up with this error.

The first macro listed below calls the second one up:


Sub angulartilt()
Call Sheet1.tilt35
Z = Range("tilt30").Value
d = 19000
l = Int(Z)
With ActiveSheet.Shapes("panelangle")
For w = 1 To l
.IncrementRotation 1
DoEvents
For zz = 1 To n
l = zz
Next
Next
End With
End Sub

this is name sheet1.tilt35

Option Explicit
Sub tilt35()

Dim myShape As Shape

Set myShape = ActiveSheet.Shapes("panelangle")

myShape.IncrementRotation 45

myShape.Rotation = 0

End Sub
Sub testme()

Dim myShape As Shape

Set myShape = ActiveSheet.Shapes("Pointer1")

myShape.IncrementRotation 45

myShape.Rotation = 0


End Sub


Private Sub Worksheet_Activate()
Sheets("PV Calculator").Unprotect
Rows(9).Hidden = Range("GB12").Value = 1
Sheets("PV Calculator").Protect
End Sub

Private Sub worksheet_selectionChange(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Address(False, False) = "C18" Then _
Range("C19").ClearContents
End With
End Sub


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$C$13" Then
Select Case Target.Value
Case Is > 0: RotateShape
Case Else: testme
End Select
End If
End Sub
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,217,444
Messages
6,136,666
Members
450,023
Latest member
ikiwawan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top