Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Macro button gets bigger when clicked Snowskier Excel Discussion (Misc queries) 1 May 27th 10 09:36 PM
VBA button on Developer ribbon can not be clicked eliassal Excel Discussion (Misc queries) 2 December 20th 09 09:30 PM
Preventing a command button from being clicked twice NDBC Excel Discussion (Misc queries) 2 June 27th 09 01:22 AM
Change Macro button color after clicked Cong Nguyen Excel Discussion (Misc queries) 2 November 30th 07 02:55 PM
let a sub recognise the name of the button that has been clicked. Brotherwarren Excel Discussion (Misc queries) 2 March 18th 06 10:56 AM


All times are GMT +1. The time now is 05:24 AM.

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

About Us

"It's about Microsoft Excel"