Solved

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

Posted on 2013-01-29
6
305 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

772 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