?
Solved

Excel VBA Running a hidden CommandBar created in Excel VB.net Add-in

Posted on 2013-01-29
6
Medium Priority
?
312 Views
Last Modified: 2013-02-08
Hi, I ran  the following code in my .NET addin create a (hidden) commandbar with a button. What VBA code do I write to use the commandbarbuttons's execute method to start code in the .NET addin.

Public Sub LaunchPrecedents()
    Dim octl As CommandBarControl
    For Each octl In Application.CommandBars("Cell").Controls
        If octl.Tag = "RefTreeAnalyser" Then
            octl.Controls(1).Execute
        End If
    Next
End Sub
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38831769
The above code is for executing not creating the commandbar. Does it not work?
0
 

Author Comment

by:Murray Brown
ID: 38858525
Hi. Sorry about late reply. What code would I use to create the commandbar? Thanks
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38859018
I thought you already have created the commandbar.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Murray Brown
ID: 38860234
All I saw was the code above, whilst searching through Google
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 38863480
Sorry I am confused. Your question is

>Excel VBA Running a hidden CommandBar created in Excel VB.net Add-in

so my assumption was you have created a hidden commandbar and need code to execute it. Is the question now

>Excel VBA Creating and Running a hidden CommandBar created in Excel VB.net Add-in

if so check following

http://msdn.microsoft.com/en-us/library/office/aa165073(v=office.10).aspx

There should be a .visible property which you can set to false.

For executing it, the code you have should work.
0
 

Author Closing Comment

by:Murray Brown
ID: 38867470
Thanks very much. The question was confusing. I appreciate the advice
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question