Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Unknown Error Message

I am running the following code:

ActiveSheet.Buttons.Add(481.5, 15, 87.75, 47.25).Select
Selection.OnAction = "ThisWorkbook.CommandButton1_Click"
Selection.Characters.Text = "Sort and Print"

Whenever the action gets to this part of the code it
creates an error message that says "400". Does anyone
know what this means?

Thanks

SS
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Unknown Error Message

You adding a button from the forms toolbar and tying it to a event macro for
a control toolbox toolbar commandbutton. You should rename you macro and
put it in a general module. Assume the macros name is

Sub btn_click()

End sub

Dim btn as Button
set btn = ActiveSheet.Buttons.Add(481.5, 15, 87.75, 47.25)
btn.OnAction = "btn_click"
btn.Caption = "Sort and Print"

--
Regards,
Tom Ogilvy



"S. S." wrote in message
...
I am running the following code:

ActiveSheet.Buttons.Add(481.5, 15, 87.75, 47.25).Select
Selection.OnAction = "ThisWorkbook.CommandButton1_Click"
Selection.Characters.Text = "Sort and Print"

Whenever the action gets to this part of the code it
creates an error message that says "400". Does anyone
know what this means?

Thanks

SS



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
Unknown Error Message Tony7659 Excel Discussion (Misc queries) 2 August 6th 09 06:34 PM
unknown #value error nomadwolf Excel Discussion (Misc queries) 0 August 17th 07 02:19 AM
Unknown Error - HELP Troy[_5_] Excel Programming 1 December 3rd 03 08:37 AM
Unknown Error - HELP Troy[_5_] Excel Programming 0 December 3rd 03 02:22 AM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 10:13 PM.

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"