Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button event clicked problem
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button event clicked problem
Change the takefocusonclick property to false of the button
This is a bug in Excel 97 -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Marek Cvrk" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Button event clicked problem
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 -- Regards, Tom Ogilvy "Marek Cvrk" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro button gets bigger when clicked | Excel Discussion (Misc queries) | |||
VBA button on Developer ribbon can not be clicked | Excel Discussion (Misc queries) | |||
Preventing a command button from being clicked twice | Excel Discussion (Misc queries) | |||
Change Macro button color after clicked | Excel Discussion (Misc queries) | |||
let a sub recognise the name of the button that has been clicked. | Excel Discussion (Misc queries) |