1
votes

I have an Excel 2010 VSTO addin developed using VS 2010. It's a RibbonUI based addin which adds a new tab to the Excel ribbon. Now I have come across a situation where I need to deploy this addin for PCs running Excel 2007.

Under Properties -> Publish -> Prerequisites I have:

  • Microsoft .NET Framework 4 Client Profile (x84 and x64)
  • Microsoft Office 2007 Primary Interop Assemblies
  • Microsoft Visual Studio 2010 Tools for Office Runtime (x84 and x64)
  • Windows Installer 3.1

I managed to install the addin using the built-in publishing feature of VS 2010, by first installing the VSTO 2010 Runtime found here. The addin is then listed as an 'active' addin under 'Excel Options -> Addins' but the ribbon tab does not load in Excel 2007. I have enabled VSTO logging and alerts as described here, but no exceptions are reported there either.

This might be a stupid question, but is there a way to get an Office 2010 addin to work in Office 2007? (I found this question on SO, but it is not quite what I want to do)

3

3 Answers

1
votes

I know this was asked in mid-2013, but I've just started creating Office 2007 and 2010 add-ins, and have encountered the same issue.

From Visual Studio, open the ribbon.xml file in your project.

Change the following line from

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">

to

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">

Notice the change from 2009/07 to 2006/01. Office 2007 uses an older XML namespace schema compared to Office 2010.

Save the file and rebuild your project. Assuming your XML ribbon file is correct, the ribbon add-in should appear in the target application. An example of a ribbon XML file for Office 2007 and Office 2010 is below:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">
        <group id="GroupID" label="Example Group">
          <button id="button1" visible="true" size="large"
            label="Button 1" keytip="W"
            screentip="I display more information."
            onAction="The name of your method/function." imageMso="HyperlinkInsert"/>
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>
0
votes

Ensure the target machine has the following registry value

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Common\General\

Name = EnableLocalMachineVSTO
Value (DWORD) = 1

https://support.microsoft.com/en-us/kb/976811

0
votes

I have fixed this problem by adding my Registry keys to HKEY_CURRENT_USER. Please check the following screenshot.

enter image description here