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: 201
Default Problem calling macro from a commandbar

In a module of a xla:

Sub Create_DCA_Menu()
Dim mynewbar, button1, button2, button3
Set mynewbar = CommandBars(1).Controls.Add(Type:=msoControlPopup,
Temporary:=True)
With mynewbar
.Caption = "DCA Menu"
End With
Set button1 = mynewbar.Controls.Add(Type:=msoControlButton)
With button1
.Caption = "Open Menu"
.OnAction = ThisWorkbook.Name & "!Open_Menu"
End With
End Sub

When I select the command bar button1 it tries to run "Open_Menu" in a
different xla.

I have multiple XLA files at different versions and they all have this same
Sub. Even though I specified ThisWorkbook.Name it still goes to the other
xla. What am I doing wrong?

--
Trefor
 
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
CommandBar problem - Question Les Stout[_2_] Excel Programming 10 November 16th 05 12:08 PM
Calling excel macro from VB 6 app problem C. Johnson Excel Programming 1 September 30th 05 04:53 PM
Add msocontrolbutton to commandbar problem Ricky S Excel Programming 1 January 29th 05 12:08 AM
commandbar - rollout problem tango Excel Programming 1 October 25th 04 01:09 PM
problem with selection when calling macro externally from VB6 [email protected] Excel Programming 1 November 4th 03 08:17 PM


All times are GMT +1. The time now is 11:29 PM.

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"