Button event clicked problem

M

Marek Cvrk

Hello,
When I run macro using button event clicked, macro is not able to
execute some actions on range object like calling of delete method or
setting of numberformat property. It falls on runtime error 1004 "delete
method of range class failed". But, when I run macro different way (workbook
open event or directly from VB editor), no error occures. I seems like some
protection problem, but I think, all protection is turned off.
Tank You for any help.
Marek
 
R

Ron de Bruin

Change the takefocusonclick property to false of the button
This is a bug in Excel 97
 
T

Tom Ogilvy

Sounds like you are using Excel 97. Change the takeFocusOnClick property of
the commandbutton to false or put this as the first line of the code:

ActiveCell.Activate
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top