excel vba code password protected would not disappear - excel

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

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.

Excel form with VBA

I was given this Excel VBA form to fix. As soon as I open it, it jumps to the form and the tool bar and all menu buttons disappear. I need to access the VBA code behind the form to fix it(atleast try). How do I get to the guts of this form. I have passwords but do not know where to enter them. Thanks in advance.
I click the sheet and a dialog box pops up:
"The cell or chart you're trying to change is on a protected Sheet. To make changes, click Unprotect Sheet in the Review tab(you might need a password)."
The problem is, I cannot see the Review Tab or any other tab. Nothing.
Open the file without activating VBA. Just open Excel, and then, in Recent Workbooks, press SHIFT and the open the Workbook. That way, the macros should not activate, and you can check the code.
Or just move the Workbook to a non trusted root, and open it.

Macro button under customized ribbon tab tries to open old Excel file

I created a custom ribbon tab on my Excel like Excel_app_v1.xlsm, and a button under this ribbon tab is connected to a macro. So when I click this button, the macro does some table importing applications.
The first strange thing is that I created this ribbon tab and the button for only this Excel file, but the ribbon tab and the button appear in all other Excel files, even if the original Excel file Excel_app_v1.xlsm is not open.
The second problem is that I created a second version of my previous Excel file with "Save-as" option. So the new Excel file is like Excel_app_v2.xlsm. When I click the button under the ribbon tab, it opens the first Excel file Excel_app_v1.xlsm, even if it is not open. I deleted the first Excel file, but then I got an error like "Couldn't find the Excel_app_v1.xlsm on the path".
So obviously the macro button under the customized ribbon tab is linked to the first Excel file, but I couldn't find the menu option to change this. I added ThisWorkbook before all the sheet expressions in the vba code, but it didn't solve the problem. The button-click is still trying to open the old excel file.
The VBA code is below. The button is linked to the Sub ImportTable. Firstly it asks the user if the user wants to continue with the process. It opens the previous Excel file right after clicking on the button, at the same time as the Message Box appears.
Sub ImportTable()
Application.ScreenUpdating = False
YearMonth = ThisWorkbook.Sheets("tab1").Cells(11, 2).Value
' The Macro button opens the previous Excel file before clicking Yes or No on the message box
answer = MsgBox("Warning! Brings the newest source file. You want to continue?", vbYesNo + vbQuestion, "")
If answer = vbYes Then
RunSASCodeViaBatFile ' Another Sub which runs bat file to run a SAS-code. But it doesn't matter. Because the problem happens before I click on Yes or No.
InsertSASFileIntoExcel
Else ' Nothing happens if clicking No on the Message Box
End If
End Sub
The clue to fixing this quickly was posted below by roncruiser, with one slight twist.
Everyone on the web seems to feel that PERSONAL.XLSB is the key here — nope. In fact, playing with that file only confounded me for even longer. Here's what I did instead:
Right click the Ribbon and select Customize The Ribbon;
Navigate to the offending macros that you've installed with buttons;
Find and click on Import/Export;
Export your custom buttons (the macros will go right along just fine);
Open that resulting file, and edit out the offending references to the other file that's causing you so much grief — example:
<mso:button idQ="x1:HideRows_0_EA10D6" label="HideRows" imageMso="_3DPerspectiveDecrease" onAction="!HideRows" visible="true"/>
I took out everything after idQ-"x1... up to the actual name of the macro. I also took out the same external reference found in onAction="... Take everything up to the bang mark.
Save this under whatever name you wish, but with the same extension (for my setup, it was called ExportedCustomizations.exportedUI (yes, that long an extension));
Repeat the first few steps here, but this time import your edited file.
Voila, all is golden.
No messing around with wiping out existing work and starting all over. Worked a charm for me, so a big tip o' The Hat to roncruiser for the clue.
Just to confirm what sumgain have write above.
It works perfectly just do as he said : remove the part after the "x1:" that refers to a specific workbook until the begining of the maccro's name.
example :
When you export your custom ribbon with the maccro attached to it it will be write like below :
idQ="x1:C:_FolderName_Filename.xlsm_Fill_Formulas_Cells"
THen you remove the part mentionned and it will become like that :
idQ="x1:Fill_Formulas_Cells"
Same for onAction keep only the Maccro Name
Then it will works perfectly as long as you the maccro's name in the workbook stay consistent if you modified the Macros name then you have to modified it in the exportedUI file.
Then when you will reload the new file you can check in the Excel Options customize ribbon on the customize button if you put the pointer on you will see "Maccro: Name of your maccro"
And not the path of the file the maccro was from.
No need to use custom UI editor or any other things such as personnal maccro at least for that and if you are not bother to have custom ribbon in all of your woorkbook.
As well it is obvious but still good to remind it, you need to have the maccro in the workbook this procedure is just there to call the maccro that are associate to the workbook, it doesn't contain the code of the maccro.
Cheers
Romain
Does this still work? I have done this in the past with success but can't seem to get it to work now.
I export the file, edit it and import it back in.
it appears to work, but when i close the Ribbon options pane, my custom buttons disappear.
Same exact thing happened to me. There's a way to get around this.
By default, when you create a macro in Excel and run that macro through a custom ribbon button, that ribbon button macro works only in the workbook that contains it.
To get around this and have the button macros work in all workbooks, you'll need to create a Personal Macro Workbook. Then any macros that you store in your personal workbook on a computer become available to you in any workbook whenever you start Excel on that same computer.
Create a Personal Macro Workbook
To get the same ribbon button macros to work on another computer, you'll need to copy the Personal Macro Workbook to another computer and store it in the XLSTART folder. The link above has all the information you'll need.
Note: Delete the old ribbon button macros. Make sure you create new ribbon button macros that reference the macros from your Personal Macro Workbook.

Quick Access Toolbar Customization: Selecting Macros causes Excel to crash

Running Office '10 on Win7
Experience: Some VBA experience, no XML experience
Hi,
I have two issues and an answer to the first may render the second mute.
Q1) Is there a way to get macros in locked add-ins to show up in the QAT macros drop-down? For example, I am running Hyperion and the essexleqd.xla and essexcln.xll add-ins are running. At least some of the macros for these add-ins are visible in the QAT macros drop-down, even though the add-in itself is locked.
Q2) Situation: Excel application is open, but there is no active/visible sheet open. When I go to customize QAT and then select macros from the drop-down, I get an error message and Excel crashes then restarts. Has anyone else encountered this, or know why this happens and has a fix?
Background:
I have a simple add-in that I want to distribute. I have locked it for viewing, but this means that I cannot create a QAT button that references the macro because the macro from the add-in is not visible in the QAT macros drop-down. I have read here (http://www.fontstuff.com/vba/vbatut03.htm) that this happens, but that I should be able to write in the name of the macro somewhere and the button will work.
Q1)
This article should help you.
How to: Create a Custom Menu That Calls a Macro
Q2)
I would guess that they crash because they can't handle that there is no active worksheet open. You probably have to start Excel by opening an empty file in order to workaround the issue.

Resources