LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Regarding Menu buttons


Hi all,

I am having the following problem regarding invoking an application
from an user created menu item.

I have added a button in the "Tools" menu and i am trying to ionvoke an
..exe file from that button and i have written the following code.

Set App = Application
'Set cbar1 = App.CommandBars("Tools").Controls.Add("Custom1",
msoBarFloating)


Set cmdBar = Application.CommandBars("Tools")
' if the button already exists then delete it
For Each cmdBarMenuItem In cmdBar.Controls
If cmdBarMenuItem.Caption = "&Make Policy" Then
cmdBarMenuItem.Delete
'If cmdBarMenuItem.Caption = "Make Policy" Then
cmdBarMenuItem.Delete
Next cmdBarMenuItem
Set newItem = CommandBars("Tools").Controls.Add(Type:=msoControl Button)
With newItem
.BeginGroup = True
.Caption = "&Make Policy"
.FaceId = 0
'MsgBox ("Welcome Prathap")
.OnAction = "!<MyAddIn.MySub"

End With

Sub MySub()
MsgBox ("Welcome Prathap")
Shell ("C:\Policy.exe")
End Sub

But neither the message box nor the .exe file is getting executed. Can
any one please help me about.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
Adding buttons to a new menu bar Greegan Excel Worksheet Functions 1 April 7th 06 07:55 AM
When I drag the mouse arrow over menu buttons, no description app. Bill Tasker Excel Discussion (Misc queries) 1 December 14th 04 10:20 AM
edit the buttons in right click menu jc_pace Excel Worksheet Functions 1 November 16th 04 06:51 PM
own-made FaceID 's or command buttons in menu bar Oscar Excel Programming 1 December 6th 03 01:57 AM
Disable Menu and command buttons Tom Ogilvy Excel Programming 0 July 14th 03 01:55 PM


All times are GMT +1. The time now is 03:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"