English 中文(简体)
VSTO Excel add-in not loading on terminal server
原标题:

My configuration is windows server 2003 (i m logged in with admin privileges), office 2003, vtso runtime 2005 se. After installing my addin, all registry keys are in the correct locations and I have given fulltrust to my assembly using caspol.exe. My addin is a application level addin.

When I run excel with regmon and filemon running I can see that excel reads the registry keys of my addin, but I do not see the AddinLoader.dll being loaded in filemon. I get no errors from vsto since it doesn t appear the runtime is even starting up. I ve read almost all of the vsto doco on msdn particularly the application addin architecture and vsto runtime overview as well as various other articles and discussions on the topic. I still can t figure out why the runtime won t load on the terminal server.

When installing this on an XP machine it all works fine and my addin gets loaded every time.

Anyone have any idea what might be preventing the vsto runtime from loading?

问题回答

I had a similar problem with Outlook 2007 on a 64 bit Windows. I added this reg key and then it worked:

[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftOffice12.0CommonGeneral] "EnableLocalMachineVSTO"=dword:00000001

Keep in mind to update Office 2007 to the latest service pack ( 3 as of now )

Never Mind I found that I was missing some registry keys after all. Got it working now.

For anyone that is looking for an answer to a similar problem then the registry keys you need to make a 2003 VSTO addin load for all users should look something like this:

[HKEY_CLASSES_ROOTCLSID{MY-EXCEL-ADDIN-GUID}]
@="MyExcelAddin -- an addin created with VSTO technology"

[HKEY_CLASSES_ROOTCLSID{MY-EXCEL-ADDIN-GUID}InprocServer32]
@="Is vsdrvtEnvironmentString value type with "%CommonProgramFiles%Microsoft SharedVSTO8.0AddinLoader.dll" as its value"
"ManifestLocation"="C:\Path\To\MyExcelAddin\"
"ManifestName"="MyExcelAddin.dll.manifest"
"ThreadingModel"="Both"

[HKEY_CLASSES_ROOTCLSID{MY-EXCEL-ADDIN-GUID}ProgID]
@="MyExcelAddin"

[HKEY_CLASSES_ROOTCLSID{MY-EXCEL-ADDIN-GUID}Programmable]

[HKEY_CLASSES_ROOTCLSID{MY-EXCEL-ADDIN-GUID}VersionIndependentProgID]
@="MyExcelAddin"

[HKEY_CLASSES_ROOTMyExcelAddin]
@=""

[HKEY_CLASSES_ROOTMyExcelAddinCLSID]
@="{MY-EXCEL-ADDIN-GUID}"

[HKEY_CURRENT_USERSoftwareClassesMyExcelAddin]
@=""

[HKEY_CURRENT_USERSoftwareClassesMyExcelAddinCLSID]
@="{MY-EXCEL-ADDIN-GUID}"

[HKEY_CURRENT_USERSoftwareClassesCLSID{MY-EXCEL-ADDIN-GUID}]
@="MyExcelAddin -- an addin created with VSTO technology"

[HKEY_CURRENT_USERSoftwareClassesCLSID{MY-EXCEL-ADDIN-GUID}InprocServer32]
"ThreadingModel"="Both"
@="Is vsdrvtEnvironmentString value type with "%CommonProgramFiles%Microsoft SharedVSTO8.0AddinLoader.dll" as its value"
"ManifestLocation"="C:\Path\To\MyExcelAddin\"
"ManifestName"="MyExcelAddin.dll.manifest"

[HKEY_CURRENT_USERSoftwareClassesCLSID{MY-EXCEL-ADDIN-GUID}ProgID]
@="MyExcelAddin"

[HKEY_CURRENT_USERSoftwareClassesCLSID{MY-EXCEL-ADDIN-GUID}Programmable]

[HKEY_CURRENT_USERSoftwareClassesCLSID{MY-EXCEL-ADDIN-GUID}VersionIndependentProgID]
@="MyExcelAddin"

[HKEY_LOCAL_MACHINESOFTWAREMicrosoftOfficeExcelAddinsMyExcelAddin]
"Description"="MyExcelAddin -- an addin created with VSTO technology"
"LoadBehavior"=dword:00000003
"FriendlyName"="MyExcelAddin"
"CommandLineSafe"=dword:00000001

Of course you will need to change GUIDs and paths to appropriate values. By Putting the addin keys under local machine instead of current user the addin will work for all users without having to repair the install after running excel for the first time. Also this only lets the office application know the addin is there and that it needs to attempt to load it, this does not give the assembly trust in the system, you need to use Caspol.exe to do that. Read the msdn article about SetSecurty to do this http://msdn.microsoft.com/en-us/library/bb332052.aspx.





相关问题
Building a Com addin for Office 2000 / Office 2007

I am struggling to find a straight forward guide to creating office addins using VSTO and VB.net. Specifically I would like to know how to be able to create a addin/ dll which can either be ...

VSTO 3.0 Excel 2007 Addin Tab doesn t display

This is a very odd problem I ve found. I have written and successsfully deployed a VSTO 3.0 Addin for Excel 2007. The problem is that the Tab for the Ribbon only shows up on NEW instances of Excel; ...

VSTO - Outlook 2007 - Display form before send message?

I m new to Outlook add-in programming and not sure if this is possible: I want to display a pop-up form (or selection) and ask for user input at the time they click Send. Basically, whenever they ...

deleting named ranges in VSTO

I have a VSTO spreadsheet, and have re-jigged the front end. I need to change some named ranges to reflect this. Couldn t see a good way of doing this, so I created other named ranges and pointed ...

VSTO remove file without resigning the manifest

I have a file added to my vsto project and I want to remove this file after publishing the project. This is because the file should only be avaliable for some customers, for others we want to remove ...

Is there a future for PowerPoint VBA/VSTO? [closed]

Does anyone know what the future holds for VBA/VSTO programming in PowerPoint? I ve been working on a Office automation project and find it frustrating to work with PowerPoint in particular since it ...

热门标签