LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default error with oleobjects.add

But you can change the font on the buttons from the Forms toolbar.

Maybe the better behavior is worth the change???

Or maybe you could use a shape from the drawing toolbar and format it the way
you want--or even your favorite picture?

Bert wrote:

The forms buttons could work, I think if I can change the color of the
buttons as I can with the commandbutton (.backcolor). Is there an
equivalent property of the forms buttons that I can set?
Thanks.

"Dave Peterson" wrote in message
...
You may want to remove the "on error resume next" lines and see what is
really
causing the trouble.

The only way I've seen that "can't enter break..." message is when I've
been
stepping through the code.

I'm not sure what you're doing with these commandbuttons, but I've always
found
the buttons from the forms toolbar much better behaved.

Bert wrote:

Thanks for your reply; however,
If I put a break point after that--even in the code that calls this
subroutine, it generates the same error message. Once this code
executes, I
cannot have a breakpoint without generating the message. Even a "Stop"
statement generates the error.
In fact, once the below code is executed, some code appears to be skipped
while other code runs sooner than code that appears earlier in the macro.

"Dave Peterson" wrote in message
...
Don't step through the code.

If you really have to step through it, don't step through that
.oleobjects.add
line.

Instead, put a break point on the line above and the line below. And
Run
between those lines--no stepping!



Bert wrote:

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

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Retrieving Worksheet.OLEObjects property Sarang Excel Programming 0 March 28th 07 02:17 AM
Error with OLEObjects helmekki[_118_] Excel Programming 2 November 24th 05 06:09 PM
OLEObjects Roy[_8_] Excel Programming 1 May 6th 05 03:51 AM
OLEObjects .. again Roy[_8_] Excel Programming 3 December 17th 04 09:44 AM
Error: Unable to get the OLEObjects property of the worksheet class Grant Excel Programming 2 August 6th 04 02:20 PM


All times are GMT +1. The time now is 02:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"