Not sure exactly where this thread should go, but here is the background:
We have a custom Excel Add-In that we install via InstallShield/InstallScript. This add-in is completely independent of the PI-DataLink and PI SMT add-ins, though one optional feature we have generates cell formulas to get current PI values (which are then evaluated if possible).
The installation works fine when PI-DataLink 3.x is installed on Excel 2003 and also when PI-DataLink 4.0.x or 4.1.x is installed on Excel 2007. Our add-in registers properly (per-user install) and can be used immediately after installation.
The problem occurs when trying to install our add-in when PI-DataLink 4.2.x (aka 2010 with SP1) is installed on Excel 2010 (32bit). If the PI-DataLink 2010 add-in is disabled (in both the "Excel Add-ins" and "COM Add-Ins" configuration in the Add-Ins window of Excel options), all is well. When the PI-Datalink 2010 add-in is enabled, our installer finishes just fine but a popup window gives the following prompt:
When clicking the Cancel button, the following error appears:
When running Excel 2010 after this happens, both PI-DataLink and our Excel add-ins work just fine, but this is not something our users will want to see after installing our add-in.
I'm not sure if the InstallScript code will help, but here it is. C++ syntax highlighting will make it easier to read, but it's not the same. None of these error messages are found in the log file after installation. If OSIsoft doesn't use InstallScript, similar tests can probably be used by making minor edits to this code and translating it to VBScript.
export prototype ExcelAddIn_Installed(); function ExcelAddIn_Installed() STRING svAddInFile; OBJECT oXL, oAddIn; begin svAddInFile = INSTALLDIR ^ EXCEL_ADDIN_FILE; // path to MyAddin.xla if FileExists( svAddInFile ) then set oXL = CreateObject( "Excel.Application" ); if IsObject( oXL ) then try oXL.Workbooks.Add(); catch LogFile_AddLine( "Workbooks.Add() failed." ); //debug endcatch; try set oAddIn = oXL.Addins.Add( svAddInFile, TRUE ); catch LogFile_AddLine( "Addins.Add( " + svAddInFile + ", TRUE ) failed" ); //debug endcatch; if IsObject( oAddIn ) then try oAddIn.Installed = TRUE; catch MessageBox( "Error registering " + IFX_PRODUCT_NAME + ":\n" + Err.Description, WARNING ); endcatch; else LogFile_AddLine( "could not register '" + EXCEL_ADDIN_FILE + "': IsObject( oAddIn ) failed." ); endif; try oXL.Workbooks.Close; catch LogFile_AddLine( "there were issues closing workbooks: " + Err.Number + " " + Err.Description ); endcatch; try set oAddIn = NOTHING; catch LogFile_AddLine( "there were issues setting oAddIn = NOTHING" ); //debug endcatch; try oXL.Application.Quit; // close Excel.exe process catch LogFile_AddLine( "there were issues quitting Excel.Application: " + Err.Number + " " + Err.Description ); //debug endcatch; try set oXL = NOTHING; catch endcatch; endif; else MessageBox( "Could not find " + IFX_PRODUCT_NAME + " file to register:\n" + svAddInFile, WARNING ); endif; end;
So I guess the big question is: what is different about trying to register an Excel add-in when PI-DataLink 4.2.x is installed vs earlier versions?
Side note: Excel 2007 and 2010 tests were both performed on Windows 2008 R2 Enterprise (64bit).