Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Command Bars

Hi

I have written some code to create a custom command bar to
open a help file in a spreadsheet.

However, i can create the button, but i dont know how to
add the hyperlink to the button to get it to open the help
file, can ayone help?

Code is as follows:

Application.CommandBars.Add tb_name
Application.CommandBars(cb_name).Visible = True
Application.CommandBars(cb_name).Controls.Add
Type:=msoControlButton, ID:=2950, Befo=1

TIA

Nath

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Command Bars

Confused by tb_name and cb_name but tjis should help

Application.CommandBars.Add tb_name
Application.CommandBars(cb_name).Visible = True
With Application.CommandBars(cb_name).Controls.Add( _
Type:=msoControlButton, ID:=2950, Befo=1)
.OnAction="myMacro"
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"nath" wrote in message
...
Hi

I have written some code to create a custom command bar to
open a help file in a spreadsheet.

However, i can create the button, but i dont know how to
add the hyperlink to the button to get it to open the help
file, can ayone help?

Code is as follows:

Application.CommandBars.Add tb_name
Application.CommandBars(cb_name).Visible = True
Application.CommandBars(cb_name).Controls.Add
Type:=msoControlButton, ID:=2950, Befo=1

TIA

Nath



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command Bars

If you are creating a button you can assign a macro for that button t
call the help file, so if the help file is some text that you hav
entered in to a spreadsheet you have the button select this sheet whe
clicked. Below is a line to add to your auto open which will assign th
macro, when the button is clicked it will run this macro (sample below
of course you will change the "ABCD" and "Macro1" to the names in you
workbook

applicaton.CommandBars("cb_name").Controls("ABCD") .OnAction = "Macro1"

assuming macro1 is in the workbook where the above is run.

The line in your macro may read,

Sub Macro1()

Sheets("Help Sheet").Select

End Sub

Hope This Helps,

Simo

--
Message posted from http://www.ExcelForum.com

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
programming command bars Little Elephant with Big Ears Excel Discussion (Misc queries) 3 January 15th 10 07:16 PM
Custom Command Bars barrowhill Excel Discussion (Misc queries) 1 March 29th 08 02:19 PM
Command Bars KneeDown2Up Excel Discussion (Misc queries) 4 January 16th 07 05:43 PM
help! How do I restore command bars? nrussell New Users to Excel 5 May 26th 05 08:19 PM
command bars Geo Siggy[_16_] Excel Programming 6 April 22nd 04 10:50 AM


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