Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default create commandbar / control button using codes

dear frank/all,
i found the below from this forum. its great and almost meet my needs.

1)first time, excel will create the toolbar and button but the next
time when i use the application, error comes out. how to ask excel not
to create as the toolbar and button already created?

2) how to change the smiley button to others using code? if all are
the same user will confuse.

3) how to name/put description to the button using code?

4) i put the following in a button. only authorised user allowed to
use the customised button created from the below. this will not affect
unauthorised personnel, rite? as i put this application in the server.

rgds



Sub create_toolbar()

Dim but1, but2, foundbut As Variant

Set foundbut = Application.CommandBars.FindControl _
(Type:=msoControlCustom, Tag:="Tender Toolbar")

If foundbut Is Nothing Then

Application.CommandBars.Add(Name:="Tender Toolbar").Visible = True

Set but1 = Application.CommandBars("Tender
Toolbar").Controls.Add(Type:=msoControlButton, ID:=2950, _
befo=1)

Set but2 = Application.CommandBars("Tender
Toolbar").Controls.Add(Type:=msoControlButton, ID:=2950, _
befo=2)

but1.OnAction = "Doing action"
but2.OnAction = "Doing action"

End If

End Sub
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
How to create control button on worksheet: Forms v. ActiveX feature? [email protected] Excel Discussion (Misc queries) 2 February 16th 08 06:32 AM
create a control button to insert rows nadswilkes28 Excel Discussion (Misc queries) 4 May 15th 07 04:20 AM
How do I create a button or control that will automatically go to Roger Excel Worksheet Functions 1 October 29th 04 01:31 AM
commandbar control and application.caller Doug Glancy Excel Programming 3 March 1st 04 09:47 AM
Add control to commandbar Dan[_20_] Excel Programming 2 August 27th 03 04:47 PM


All times are GMT +1. The time now is 10:37 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"