SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created an Excel workbook in Visual Studio 2010 using VSTO, and it fills a table with data retrieved from a WCF service. The service was added to the project using the standard "Add Service Reference..." method, and it uses the code-behind file to create the service proxy, get the data and then bind it to the table.

This all works fine and dandy when I publish the workbook and run it locally. However, when I publish it to SharePoint I just get static data. There are no error messages shown immediately, and I cannot find any errors in the log files.

In order to rule out the service reference as being my main stumbling block, I removed the service code and simply wrote a simple code-behind method to set some static text into a cell - and it still won't run on SP 2010!

Has anyone published a VSTO Workbook to SharePoint 2010 and had the code-behind actually work?

share|improve this question
up vote 1 down vote accepted

This isn't possible because code-behind created with VSTO does not execute on the server. Not even VBA will execute on the server! Please see this post for more details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.