0

My understanding is that when I create a workbook VSTO solution, I need to register (implicitly or explicitly) the solution in the registry. When developing the VS takes care of this.

If I wanted to have more than physical xlsx files with different names and reuse the VSTO code what to do?

A simple copy/paste of the workbook file won't work of course. I don't want to register each new workbook in windows registry since this could be a serious hassle.

Typical case would be: Say a user collects monthly data in workbook xlsx file. You need to run the VSTO code in each workbook xlsx file separately. As a result you end up having 12 sheets per year. Using VBA, you could easily copy the files and change the names - How to do the same when VSTO is used?

I thought of using a template but I wanted to ask before I waste time on it.

I am using VS2010, C#, Excel 2007.

Community
  • 1
  • 1
NoChance
  • 5,632
  • 4
  • 31
  • 45
  • You can create an VSTO Add-In. That can run on any file without you re-registering it again and again. – Siddharth Rout Oct 18 '14 at 22:40
  • Correct, but that would be an Application-Level (opposite to document level), meaning that it would be part of MS-Excel every time the user uses MS-Excel, which some may not like. Thx anyway. – NoChance Oct 19 '14 at 20:13
  • I am sorry I do not understand. Whats wrong with making an application level Addin? How will it interfere with the normal working of excel. I mean why do you think the users will not like it? people who want to use it can use it and people who do not want to use it can simply ignore it... If you want document specific then go in for VBA. You may either use custom UI Editor as show [here](http://stackoverflow.com/questions/8850836/how-to-add-a-custom-ribbon-tab-using-vba/8852767#8852767) or do the same thing via VSTO. But then you will have to do it individually for each document. – Siddharth Rout Oct 20 '14 at 06:10
  • Not all work environments allows for installing add-ins without a real need for them on corporate machines. Excel, already, has a lot of functions that confuses the non-professional, so people don't want to see more of what they don't use. VBA is not good enough for many reasons (at least in my case), so I was hoping that VSTO could be the answer. Thanks again for your help. – NoChance Oct 20 '14 at 20:56

0 Answers0