B
Bert
I'm trying to make a grid of commandbuttons on a spreadsheet but it is
generating this error message:
Can't enter break mode at this time
Then the code that follows is not not being executed (properly, at least)
and other errors seem to be arising as well (Variables not being assigned
values, etc.)
Here's the code I'm using to create the commandbuttons that seems to be
causing the problem:
On Error Resume Next
For b = 1 To aRows '
CurTop = StartTop + (VOffset * b)
For c = 1 To aCols
Application.DisplayAlerts = False
Worksheets(2).OLEObjects.Add ClassType:="Forms.CommandButton.1",
Link:=False _
, DisplayAsIcon:=False, Left:=StartLeft + (HOffset * c),
Top:=CurTop, Width:=60, Height:=57
Application.DisplayAlerts = True
If a >= TotalItems Then
On Error GoTo 0
Exit Sub
End If
a = a + 1
Next c
Next b
On Error GoTo 0
Thanks,
Bert
generating this error message:
Can't enter break mode at this time
Then the code that follows is not not being executed (properly, at least)
and other errors seem to be arising as well (Variables not being assigned
values, etc.)
Here's the code I'm using to create the commandbuttons that seems to be
causing the problem:
On Error Resume Next
For b = 1 To aRows '
CurTop = StartTop + (VOffset * b)
For c = 1 To aCols
Application.DisplayAlerts = False
Worksheets(2).OLEObjects.Add ClassType:="Forms.CommandButton.1",
Link:=False _
, DisplayAsIcon:=False, Left:=StartLeft + (HOffset * c),
Top:=CurTop, Width:=60, Height:=57
Application.DisplayAlerts = True
If a >= TotalItems Then
On Error GoTo 0
Exit Sub
End If
a = a + 1
Next c
Next b
On Error GoTo 0
Thanks,
Bert