Is it possible to click buttons in the toolbar with macros in Excel 2010? - excel

Is there anyway to make a macro that can click buttons in the tool bars of Excel? I'm using Excel 2010.

Here's how you can record a macro, which will capture your actions.
For Excel 2010:
http://www.dummies.com/how-to/content/how-to-record-a-macro-to-automate-tasks-in-excel-2.html
For Excel 2013:
http://www.dummies.com/how-to/content/how-to-record-new-macros-in-excel-2013.html
In your case, to take this even further, you can do coded UI testing right from Visual Studio. For what you are trying to do, this is even better than only trying to automate a button-click to fire a custom add-in.

Here is a way how you can achieve it with excel 2010:
File->Options->Quick Access Toolbar.
in the "Choose Commands From" list you click "Macros". Select the macro and click add.
If you want change the name of the button you can click "Modify".
Hope it will help you.

Related

Adding macro button to trigger a specific Macro

Whenever I add a custom Macro button to the Quick Access Toolbar , it is a generic Macro window invocation button. What I want is that if I click on the button, a specific Macro should directly start running. As of now there are 2-3 steps before I do that. First of all I click on the icon on the quick access toolbar , another small drop down shows up unnecessarily as shown here ( not sure why Add Ons is appearing here, I never added)
Secondly, if I click on the bigger Macros icon in the dropdown again , I get a dialog box where I have to choose macro from a list. I don't want to go through all this. As soon as I click on the button, a specific macro (I should be able to configure name of the macro) should start. I know there is a shortcut available for triggering a specific macro but I prefer a button.
If you don't want to configure QAT buttons manually you may consider developing a COM based add-in instead. See Walkthrough: Create your first VSTO Add-in for Outlook for more information.
To customize the ribbon UI you can use the designer provided by VSTO, see Walkthrough: Create a custom tab by using the Ribbon Designer.

excel vba code password protected would not disappear

I have opened an excel file containing VBA password protected (not belonging to me) and from that moment on what happens is that the code remains in the VBA editor even if I close ALL the files (see atteched pic)
Such filed was called treelist and in the VBA editor "solver.XLMA"
Put in other words. Whatever excel of mine I opened now with or without vba code once I click "editor" the first thing I see is that "solver.XLMA" that I can not access nor delete. It is really anoying because I dont know what this code is doing.
(note: yes, I closed excel several times and opened it again. solver.xlma was still there)
As you see in the picture the "solver.xlma" stais even if I close all the excel workbooks.
Some idea of how can I get rid of it and what is going on here?
thx
It is a solver add-in. To turn it off:
Click the File tab, click Options, and then click the
Add-Ins category.
In the Manage box, click Excel Add-ins, and then click Go. The Add-Ins dialog box appears.
In the Add-Ins available box, clear the check box next to the add-in that you want
to deactivade (Solver), and then click OK.
This is the answer:
That's the Solver Add-In. Go to File > Options > Add-Ins, then click Go beside "Manage Excel Add-ins". Uncheck the Solver Add-in and hit Ok

Creating a button on Excel Ribbon to open Userform Window

I have developed a VBA userform interface that allows the user to input values, have it calculate results, and then print them out into the worksheet. I am wondering if there is any possible way that I can have a button on the excel ribbon, say under the "Data" tab for instance, that would elicit the userform interface to open.
Currently the only way I can use the interface is by Developer>>Visual Basic>>Clicking on Userform>>F5. This also limits the userform in that it can only be used in one particular workbook as opposed to many. Or if it was somehow possible, to make it an add-in instead.
Any help is greatly appreciated!
The easiest way to add custom tab and/or button to Ribbon is to use Custom UI Editor Tool for MS Office Ribbon. Follow the links provided in comments to your question too. There you'll find many useful information.

VBA control over the ribbon?

I am in the process of creating a VBA add-in for Excel 2010, and I used the "Custom UI Editor for Microsoft Office" tool to create my own ribbon.
However, I would like to give the user the option to load my add-in without displaying the ribbon, or with different parts of the ribbon visible.
With menus, I know you can completely control them programmatically, but ribbons seem to work differently.
Is there a way in VBA to not load my customUI.xml ribbon tabs on startup?
Is there a way to remove items from (or add items to) these tabs at runtime?
here is a whole slew of help on this subject Awesome Ribbon Help. I think points 2 and 3 are of particular interest to you.

Custom Menu visible to one document in Excel

I have created customized menu and toolbar in MS Excel. I wanted to show this menu and toolbar to specific document only. When I open any other xls file, it shows that menu and toolbar.
MS Excel 2003
How to do that using vba-excel macro or any other way to do that?
If you need more information, please ask me.
Thanks :)
OK - so this website will help you:
http://www.ozgrid.com/VBA/custom-menus.htm
It actually works in Excel 2007 also, but adds the menu under the Add-Ins tab.
You basically need to access the code for ThisWorkbook in the VBA application. From there, you can modify the Application.CommandBars object to do what you need.

Resources