Button event clicked problem

  • Thread starter Thread starter Marek Cvrk
  • Start date Start date
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
 
Change the takefocusonclick property to false of the button
This is a bug in Excel 97
 
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
 
Back
Top