Excel RibbonBar is not showing when Excel file is opened directly - excel

I have developed a custom Excel 2010 Add-in and custom RibbonBar using VS 2010. When I install the custom Add-in for Excel, the RibbonBar is displayed or shown properly when Excel is opened. BUT, when I double-click the Excel file (.xlsx), the ribbon bar does not show on the Menu.
Please advise.

Few checks that may help
Disable all addins installed and then open a xlsx file by
enabling one addin in turn.
Start excel, create a new excel file
save, close and open it again to check if ribbon appears. If it work
fine for this, there could be some problem in file format or macro
attached with the file

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.

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.

Excel Addin (File.xll) will not open properly in excel 2007, but works fine in 2003

How do i make excel 2007 treat the xll addin the same when opening programatically, as it does when browsing via the addin-manager?
i have an excel addin (XLL file) that works fine on an old XP box, running excel 2003 (Excel XP)...but not on windows 7 running excel 2007.
On my new Windows 2007 machine, running Office/Excel 2007, the same XLL has odd behavior.
In Excel 2007, When i goto the excel addin manager, browse to the xll, and then load it...the XLL works just fine...but just for that session.
But, after i close this instance of excel, and then re-open excel (so, now the adddin will be loaded programatically from the Excel\Options list from the registry - which is how excel normally loads addins)....Excel throws an error saying
"The file you are trying to open, 'Addin.xll' is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"
If i click 'yes', then the xll opens with garbage text, and does not work.
However, if i kill excel, open the registry, goto HKEY_Current_User\Software\Microsoft\Office]12.0\Excel\Options\
and remove the [OPEN] item which points excel to open the addin programatically...then excel opens fine (without the addin loading...obvs).
Again, if i then goto the Excel Options --> addin manager
and re-add the Addin...then it will load and work just fine.
But again, after i close excel and re-open., i'll get the same error from above.
I've read that Excel sets the 'Current Working Directory' when you open the addin from the "addin manager --> browse" method...but not when excel opens the addin programaticaly.
So...what can i do to make excel open my addin correctly? It works fine with Excel 2003...and it works fine the 1st time in Excel 2007...so its got to be a problem with Excel.
i figured the answer to my own question...so i thought i'd share.
On the new windows 7 box, there must be an environment variable 'PATH' to the folder directory where the addin and its associated libraries live.
My addin files are located in C:\AddinFolder\
So here are the steps to fix
1) right click on MyComputer and select "properties"
2) select the "System protection" item from top left list
3) click on the advanced tab
4) click in the button "Environment Variables"
5) in the lower section (system variables) scroll down till you find the "Path" variable and then select "Edit"
6) Add to the end of the string the path to your addin library. The list is a set of directory paths, separated by semicolons. So, i added ";C:\MyAddin\" to the end of the string, which already had a bunch of paths listed for a variety of other programs
7) click Ok a couple times to get out of that set of dialogue boxes
8) open Excel with the addin set to load, and voilla...it works perfectly
**note...don't delete the contents of the Path variable..just add to it...else some other software might stop functioning properly

Recovering datas from an Excel/ActiveX spreadsheet

I'm having the following issue: I've an Excel spreadsheet with a lot of VBA codes and ActiveX controls, including RExcel formulas.
The Excel version is 2007.
When I try to open this file, Task Manager says Excel isn't answering and something starts like if Excel started running endless codes; I deactivated each control and it still seems broken.
I would like to recover at least some formulas I've written in that spreadsheet, but this is actually impossible by opening the spreadsheet in conventional way.
Could you tell me how I can "read" formulas and text in that spreadsheet without opening it by Excel?
Thanks,
Indeed have calculation set to manual for a start.
Now set your security settings such that macros and activeX are disabled:
Excel Options > Trust Center > Trust Center Settings... > Macro Settings > Disable all macros with notification
For ActiveX I am not sure if there is a menu in excel-2007 like for macros, but if there is make sure it is set to not run as well.
Now you can open your excel workbook and it will not run your macro's and shouldn't auto calculate or update!
ADDED: I have had something like this in the past and this is what worked in 1 occasion: install an other office excel application, like open office (the calc application has the excel functionality) and see if it opens in that application. Then if it does, save the file (under another file name) and close it. Open the new file under MS Office Excel, and see what is still recoverable.
Good luck!
use a tool like 7zip to extract the files. the sheets/formulas are in the .xml
the code in a macro enabled spreadsheet is in a .bin file
this can be read with MalOfficeScanner

VBA created with Excel 2003 loaded OK in Excel 2007, but there's nothing in Project tree of VB editor

I have created a VBA in excel 2003 and save it in xla format. This AddIn add a new menu and some submenu in toolbar of Excel. All work well until I upgrade to Office 2007, then I open the xla file. No error message shown, but when I view the macro List, no items there. I open the Visual Basic editor. My old Project (named ML) is still there, but nothing in the Project tree, just default files as when add a new blank project.
I open the xla file with notepad, and my variable, function name are still there. Anyone has experience in this weird behavior, please give me a clue.
Thanks in advance.
Toolbar add-ins generally appear in the add-ins tab of the ribbon in Excel 2007. Make sure you have the add-ins tab displayed (if not you can turn it on under excel options).
If that still isn't working you'll need to go online and read up on altering the code to conform to the ribbon - there are a lot of resources out there should you need to do this.

Resources