i have a userform in excel which i want to convert to an addin or menu item in excel 2003 - excel

i have wriiten a small vba code(userform & modules associated) for concatenating files in a user inputed folderpath. Currently i have this placed in personal.xls and everytime after opening excel i press ALT+F11 and go to the userform and run it (press F5).
I want this userform to be placed in as an addin or menu item in excel (available for all spreadsheets).
I know i need to assign a macro to a menu-item i add, but i have many subs (both in userform & modules associated) and not have instantiated my userform anywhere. i don't know which of these subs i need to assign to menu-item.
MAIN GOAL: is i wan't a menu item (or addin) which when i click pops up the userform. (afterwards running same as when i ran it from visual basic editor).
THINGS TRIED: i tried copying the userform & modules to a new project and saving it as an excel addin (.xla file) and placed the addin in excel add-ins folder. I have selected the addin from Tools>Addins option in excel. But, i think this way i was not able achieve what i needed as i don't see any new option/menu-item added to excel.
Thanks in advance
ps: I'm new to vba and just started working on it a week ago, so give me more detail in your answers.

You did it right with add-in but in order to use your code you need to add menus, check this out.

Related

Is there a way to share a Excel VB Macro as a tool for all future workbooks?

I made a VB script that re-formats data exported to excel from a website so that it is compatible with a geocoder. As of now every export I have to go in, past the VB code run it and save the changes. I am wondering if there is a way to make the VB code available as a tool for all workbooks so it is just a matter of opening the xls file clicking a button and saving it?
To expand a little on BigBen's comment:
Open the Excel file with your code in. Open a new blank Workbook. Open up the VBA Editor (Alt-F11).
Drag the module which contains your code to the new workbook (in the left-hand navigator pane). You should see it add to this new Workbook.
Save you new workbook as MyFunctions (or whatever name you fancy) but choose the "Excel Add-in (*.xlam)" file type. You should see a new file appear in your folder as MyFunctions.xlam.
Back in Excel, from the File menu, choose Options (right at the bottom). And then Add-Ins from the left-hand list. At the bottom will be a drop-down box "Manage: Excel Add Ins". Hit Go...
You'll a list of the add-ins that your Excel knows about: some will be checked (that is they will be loaded at start-up) and some not.
Choose Browse, and navigate to wherever you saved MyFunctions.xlam. And double click on it. You may get a security warning (as your addin doesnt have a digital signature) but just go ahead and enable it (as you wrote the code: this is not blanket advice!). Close Excel (this remembers your choices).
When you next open Excel you should see your add-in file open in the VBA Editor, and your macros and UDFs available in whatever worksheet you are using.

.xlam add-in does not work on other computers giving two workbooks with the same name error

I created 2 simple macros just to delete some columns and sort the data on Excel. It does not open a file, just works on the active workbook. I saved the macros as .xlam add-in to distribute other team mates.
I also created a custom Ribbon menu. In the ribbon menu I created 2 buttons and assigned my macros one by one. Now, on my computer, when I click on the button in the Ribbon menu, it calls the macro and the macro works perfectly.
When I add the same add-in to my friends' computers it imports the add-in succesfully. It creates a local copy under Add-In file as well.
When it comes to run the macros, however, it gives the following error ""Sorry, excel can't open two of the same workbooks at the same time".
No need to say there is not 2 workbooks with the same name, there is even no other workbooks opened. What could be the problem? Since it is not code related (at least it seems like) I don't share any code here. If you want I can, however, I receive the error as soon as I click on the button in the ribbon menu on my friends' computers. (FYI I created ribbon menu at my friends' computers as well.)
Any help will be appreciated.
I was able to resolve this issue by removing all of the menu items associated with the add-in (do so by customizing the ribbon) and then rebuilding the menu items. In my situation the location of the add-in changed resulting in a path issue.

macro in right click menu for all workbooks

I wrote several macro with SAP scripting and other features.
For few of my macros, i need to select a cell, and then run the macro.
All these macros are stored in a add in, hence all my macros are available on every workbook.
I would like to share my addin with my colleagues but I would like to make the macros available from the right click menu.
All pieces of code found here and elsewhere indicate to have a piece of code located in "thisworkbook" tab. Hence the custom right click menu is only available on a specified workbook.
Is it possible to have my macro stored in my add-in accesibble from right click menu for all workbook that I open/use ? like the macro ribbon ?
thank you

What is the easiest way to add Macro automatically to a set of Excel Files

I have a macro function that I have added to an excel file. My question is how can I add the same macro function to a specific set of excel files without copy pasting the macro in each excel vba editor.What is the easiest way to achieve this?
The objective is for the users who have no knowledge on excel macros should be able to easily add Macros to excel and execute it.
If the people who are importing the macros are also the users of these macros you might want to create an add-in out of your vba macro. The procedure is described here. The users would just have to install the add-in on their PCs once(step 4). They can then use the add-in for several Excel-files.
This needs to be done by each user once:
Step 4: Install the Add-In:
Go to Tools > Add-Ins to open the Add-Ins dialog. If you have stored your Add-In in the default location you will see its name displayed in the Add-Ins available: window (if you have stored your Add-In in a different folder, use the [Browse] button to find it). Click on your Add-In's name to see its description at the bottom of the dialog box.
To install your Add-In place a tick in the check-box next to your Add-In's name and click [OK]. [Click the thumbnail below to see a full-sized image]...
Installing your Add-In (Excel 2002) Installing your Add-In (Excel 2000/97)
As soon as the Add-In is installed its functions will be available in Excel. Find them in the User Defined section of the Function Wizard (Paste Function Tool) or simply type them into a cell as you would any built-in function. The Add-In will remain installed until you return to the Add-Ins dialog and uninstall it by removing the tick from the check-box.

How to display 2007 excel ribbons

I was looking for a vba method to hide al excel ribbons on file startup.
From this website I copied into my worksheet's "Thisworkbook" two subroutines that hide all ribbons upon file activation and show them again on file deactivation.
This worked.
However, I need to know how to get back to all my macros?
Every time I start the spreadsheet the ribbons are hidden by my vba code. How do I get to the ribbons and perform other editing on my workbook?
I have searched for a solution to no avail.
how to get back to all my macros?
You mean start VBA IDE?
Alt-F11 does it.

Resources