Solved

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

Posted on 2013-01-29
6
299 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:murbro
  • 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:murbro
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

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

Accepted Solution

by:
CodeCruiser earned 500 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:murbro
ID: 38867470
Thanks very much. The question was confusing. I appreciate the advice
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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 Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now