-1

I built an Add-in for Excel using VSTO, and deployed it over...

now i have an updated version (where there are some new Toolbar Controls, a new column, and some bugs fixed in the behaviours).

my problem is that my client was working with the previous version, was filling his Data inside the sheet.

How can I Update the VSTO Add-in, and Migrate the Data ?

thanks for your help

Tomer W
  • 3,395
  • 2
  • 29
  • 44

1 Answers1

1

Well it depends on how you created the add-in. An add-in is NOT coupled with any workbook (which is different to document level customization) unless you make it so.

Basically you just change your code, deploy a new version and your client will install it. When Excel is launched the new version will be used so if you have a button on Ribbon, the button now will use the new version.

If you, for any reason, make the add-in tightly coupled with a specific workbook (format) you'll have to deal with it. So for example, if the new version is now expecting a new layout of data you'll either ask clients to change it manually or write a function that will do that for them.

Example: We have a VSTO Word add-in that does a lot of stuff, the add-in is using a template which has a version like (1, 2, 3, 4 ...) when we change the template (e.g. adding styles, addin shapes, removing shapes, etc.) we also maintain a recursive update method that is triggered on opening a document. The method is checking the version of the template with the version hardcoded in the code, comparing and if the template version is older will trigger the update functionality (step by step, so from v1 to v2 then v2 to v3 and so on till it reach the latest version)

Hope that helps

PetLahev
  • 688
  • 3
  • 18
  • can you elaborate how you Keep/Update the Document Version? hidden settings sheet? Document Metadata? Saved elsewhere? how can you prevent client to change it ? – Tomer W Sep 29 '16 at 19:37
  • @TomerW it's MS Word so it's a bit different but still can apply to your need. So we keep the template version in [custom document properties](https://msdn.microsoft.com/en-us/library/dhxe2d75.aspx), say #1, in the code we have a constant *templateVer=1*, when a document is opened, it's checking the version, if the same, do nothing. if the version in **code** is higher then we call our function the update. if it fails for any reason = it's user problem, they should not modify template although we always try to fix the most common problems. Of course they can change data but not layout – PetLahev Sep 29 '16 at 20:23
  • thanks, that's highly relevant and helpful. Do you have any other tips on how to handle the Template changes with data already inserted? (i know it is very specific, but pointers always help) – Tomer W Sep 29 '16 at 20:32