![]() |
#1
|
|||
|
|||
![]()
Hi,
Can anyone tell me why I'm getting the Runtime Error '91' "Object variable or With block variable not set" which comes up right at the end of running this code? The line in blue is the issue. Sub Random() Dim bulbs As ShapeRange Set bulbs = ActiveSelectionRange Dim Num As Integer Num = 1 Counter = 1 Do Until Counter = bulbs.Count With bulbs(Num).Fill .ApplyUniformFill CreateRGBColor(255, 0, 0) Num = Num + Int((3 * Rnd) + 2) Counter = Counter + 1 End With Loop End Sub Last edited by noj; 19-10-2011 at 02:10. |
#2
|
|||
|
|||
![]()
Never mind. I fixed it with an If Then statement. I think the code was referencing a shape that didn't exist at the end.
|
#3
|
||||
|
||||
![]()
Hi.
Yea... Looks like nothing was selected so the shaperange index wasn't set to a shape. ~John |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't loop thru layers | xxxslowjoe | CorelDRAW/Corel DESIGNER VBA | 1 | 06-06-2009 13:52 |
Simple Loop? | dan | CorelDRAW/Corel DESIGNER VBA | 3 | 13-10-2004 14:31 |