[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2013-01-29
6
Medium Priority
?
313 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

650 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