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