Reputation: 2585
We've created an VSTO 2010 project, containing a ribbon bar for Excel, which runs nicely, however it now turns out some of our customers will be running Office 2007.
We've attempted to install it on 2007, with no luck (the ribbon is listed as a running add-in, however it doesn't appear among the ribbon tabs in Excel). I've tried following the steps mentioned in this SO question (replacing the 2010 references dlls with 2007 reference dlls), with no success.
Any suggestions that avoid having to create a new 2007 project (which as I understand would involve uninstalling Office 2010 on our development machines, and installing 2007 instead) would be very much appreciated.
Thanks!
Upvotes: 3
Views: 949
Reputation: 2585
Gah. It turned out to be a problem with the schema on the ribbon XML, which we spotted when we'd stripped the ribbon XML down to a single label, to see if it was any of the controls etc in the XML causing the incompatibility.
We were using (quite possibly copied from an example)
xmlns="http://schemas.microsoft.com/office/2009/07/customui"
but once we changed it to:
xmlns="http://schemas.microsoft.com/office/2006/01/customui"
the ribbon appeared immediately, which fitted in with the symptoms of the ribbon appearing as a running add-in, but not being visible in Excel itself. As mentioned previously (see this SO post for the details), it was necessary to use the v12 office and interop dlls.
Upvotes: 5
Reputation: 28069
You can install 2007 and 2010 side by side, and avoid any issues switching between the two by running the following in command line, or placing this in a batch file, either works:
reg add HKCUSoftwareMicrosoftOffice14.0WordOptions /f /v NoReReg /t REG_DWORD /d 1
reg add HKCUSoftwareMicrosoftOffice14.0ExcelOptions /f /v NoReReg /t REG_DWORD /d 1
reg add HKCUSoftwareMicrosoftOffice14.0PowerPointOptions /f /v NoReReg /t REG_DWORD /d 1
reg add HKCUSoftwareMicrosoftOffice14.0AccessOptions /f /v NoRepairNeeded /t REG_DWORD /d 1
reg add HKCUSoftwareMicrosoftOffice12.0WordOptions /f /v NoReReg /t REG_DWORD /d 1
reg add HKCUSoftwareMicrosoftOffice12.0ExcelOptions /f /v NoReReg /t REG_DWORD /d 1
reg add HKCUSoftwareMicrosoftOffice12.0PowerPointOptions /f /v NoReReg /t REG_DWORD /d 1
reg add HKCUSoftwareMicrosoftOffice12.0AccessOptions /f /v NoRepairNeeded /t REG_DWORD /d 1
As for your code, I find that the Excel Interop code for 12 and 14 is more or less interchangable. Are you using anything in Excel Interop 14 that isn't in 12?
Two projects may not seem ideal, but you may need to go this route. The upside is that you will be able to more or less copy and paste everything, espicially if you write everything for the 2007 project, and copy/paste across to the 2010 project, as opposed to the other way around.
Hope this helps
Upvotes: 2