Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 17th, 2004, 03:48 PM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CommandButton & OnAction or HyperlinkType

Good day everyone!

I'm trying to Create a Commandbutton for any excel application with VB .Net.

Thus button have to be able to open(run) any Stand-alone application

Now, I was trying to use OnAction event but this only run Macros and I don't want to run a macro(On action event cann't run any shell command) also I don't want to create any module.

So What I did was: I used Hyperlinktype as follow
This was done on a stand alone app
Public Sub AddHyperlink()
    Dim objButton As Office.CommandBarButton
    Dim objBar As Office.CommandBar

    Set objBar = ActiveExplorer.CommandBars("Standard")
    Set objButton = objBar.Controls.Add(msoControlButton)

    With objButton
        .Caption = "Slovaktech Web &Site"
        .Tag = "SlovaktechWebSite"
        .HyperlinkType = msoCommandBarButtonHyperlinkOpen
        .ToolTipText = "c:\Demo\RunIt.exe"
    End With

Set objButton = Nothing
Set objBar = Nothing
End Sub

its work but know I have to confirm the security protection from excel.

My cuestion is: Is there another way to create this command button and at the same time make it available to run an specific app.?


JM





Similar Threads
Thread Thread Starter Forum Replies Last Post
CommandButton to display directory mona_upm84 Excel VBA 2 September 25th, 2008 09:21 PM
How to apply Khmer Unicode to CommandButton Chieng Sisovin VB.NET 2002/2003 Basics 3 September 12th, 2007 03:09 AM
Disable CommandButton in Userform mmm Excel VBA 6 November 20th, 2006 07:49 AM
Help! CommandButton Caption Driving Me Nuts! phoenixblue C# 0 September 29th, 2006 03:19 AM
Toolbar CommandButton Kenny Alligood Beginning VB 6 1 September 30th, 2004 06:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.