none
How to copy a VSTO Document level worksheet without registery installation? RRS feed

  • Question

  • 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.

    Saturday, October 18, 2014 8:21 AM

Answers

  • Hi,

    >> I need to register (implicitly or explicitly) the solution in the registry.

    Document-Level customization is not registered in the system registry but in the document itself.

    Architecture of Document-Level Customizations

    By default, the custom.vsto, custom.dll and custom.xlsx are the same directory.  But it is flexible, you are able to copy, move and rename the custom.xlsx after publishing it by Visual Studio.

    Besides publishing by using Visual Studio, you could also attach Managed Code Extensions to Documents programmatically.

    How to: Attach Managed Code Extensions to Documents

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 23, 2014 2:53 AM
    Moderator
  • Hi,

    >>Attaching managed code extension approach requires Visual Studio and extensions to be on the client's machine, which is something I don't want to ask business users to do. I wish it was as simple as copying an Excel file with embedded vba code<<

    We can use the ClickOnce to publish the document level solution, then the end-users are able to copy the workbook or rename it as the Excel file with embedded VBA code.

    You can get more detail about publish Office solution form link below:
    Deploying an Office Solution by Using ClickOnce

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 30, 2014 8:16 AM
    Moderator

All replies

  • Hello,

    I'd suggest developing an application level add-in instead. You may find the following links helpful:

    Excel Application-Level Add-in Development

    Walkthrough: Creating Your First Application-Level Add-in for Excel

    Saturday, October 18, 2014 3:38 PM
  • Hi

    Thanks for suggesting an application level solution. However, as I understand, Application Level solution would cause the solution to be available in all instances of Excel on the user machine. Some users may find this annoying, at least in my case. Thanks again.

    Saturday, October 18, 2014 4:44 PM
  • AFAIK, the simplest deploy is copy all of the content in Debug folder to your target machine and double click *.vsto file to finish deployment although it seems very non offical.

    Thursday, October 23, 2014 2:00 AM
  • Hi,

    >> I need to register (implicitly or explicitly) the solution in the registry.

    Document-Level customization is not registered in the system registry but in the document itself.

    Architecture of Document-Level Customizations

    By default, the custom.vsto, custom.dll and custom.xlsx are the same directory.  But it is flexible, you are able to copy, move and rename the custom.xlsx after publishing it by Visual Studio.

    Besides publishing by using Visual Studio, you could also attach Managed Code Extensions to Documents programmatically.

    How to: Attach Managed Code Extensions to Documents

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 23, 2014 2:53 AM
    Moderator
  • Jeffrey, thanks for the feedback and for correcting my knowledge about the registration. Attaching managed code extension approach requires Visual Studio and extensions to be on the client's machine, which is something I don't want to ask business users to do. I wish it was as simple as copying an Excel file with embedded vba code. Thanks again.
    Thursday, October 23, 2014 12:40 PM
  • Hi,

    >>Attaching managed code extension approach requires Visual Studio and extensions to be on the client's machine, which is something I don't want to ask business users to do. I wish it was as simple as copying an Excel file with embedded vba code<<

    We can use the ClickOnce to publish the document level solution, then the end-users are able to copy the workbook or rename it as the Excel file with embedded VBA code.

    You can get more detail about publish Office solution form link below:
    Deploying an Office Solution by Using ClickOnce

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 30, 2014 8:16 AM
    Moderator