VSTO 2003 basics

Hi,

I am new to this and I need to know some very basic info about developing Excel application using .net. I am using VS 2003 and framework 1.1 and VSTO 2003.

I developed a hello world excel application. In that I added some value in a cell of a worksheet and some basic stuff.

The application I am trying to develop loads data from the database and populate excel sheet. After that I want to be able to get values from socket and keep on updating values in excel sheet. I also want end user to be able to use usual excel features such as adding new calculated cells to the worksheets, adding worksheets, changing cell color, sorting, Saving As e.t.c

Is this possible if yes, then what would I have to deploy on user machine

I dont see this solution generating any .exe. I was hoping the excel file will be self-contained and all the application specific DLLs will be attached with the Excel file and user will be able to move the excel file wherever he wants...but I think this is not the case...Can someone please calrify

 

Thanks,

 



Answer this question

VSTO 2003 basics

  • lx

    Yes, the proposed approach should work. If we're still talking about VSTO 2003 then I should mention that the location of the solution files is stored IN the Office file in a custom document property. This can be set in the Visual Studio IDE, in the properties pane (Assembly Link Location) or it can be changed directly in the file (File/Properties/Custom properties). You need to make sure this path is correct, then it shouldn't matter where the user saves the workbook (as long as the file path isn't relative).

    For the second question, yes, this approach could work. Possibly, even, you could set this up to check a network location and alert the user - even opening the network folder containing the new version.



  • tsith

    Hmmm. I just uninstalled this older version a couple of days ago, so I'm not sure how much help I can be... But since no one else has answered, here's my view :-) The following observations are true in a general way for both VSTO 2003 as well as 2005, although the exact details may differ.

    Your basic idea is what VSTO was designed for: linking managed code to the workbook in place of VBA. Everything is not, however, self-contained. Besides the workbook file there is, at the very least, a dll. There can also be supporting files. And none of these will "move" with the Excel file.

    Since a VSTO solution is a managed code solution, security and deployment follow .NET Framework guidelines. Trust has to be granted to the various executable components; in the case of a VSTO solution, Full Trust. The trust can be by strong name, by folder, by digital signature or by a combination of all these. Trust is usually made by "caspol" (you can look that up on the msdn site) when distributing a solution.

    All components of a solution do not need to reside in the sam folder. You could, for example, have the DLL and other components in a network (even shared) location. This would allow the user to put the workbook anywhere he likes, as long as he's connected to the network. This would also make it easier for you to update the solution. OTOH, there would be lots of network traffic...

    Also keep in mind that a VSTO file can be opened and used as a normal Excel (or Word) file, even if it can't find the .NET components. The user would receive a message to this effect, but he can open and work with the file using the normal Excel tools.

    I hope this answers some of your questions



  • rykk

    Thanks Cindy,

    One follow up thought...I can make some kind of installation program that user must run in order to make the Excel sheet run on his computer. In the installation program I can copy Dlls and other supporting files to some pre-determined windows folder and make my Excel application to look at those folders...After that user will be able to copy paste the Excel sheet where ever he wants on the machine....Is this something that is commonly practiced Since the excel sheet is sort of "live", I am not sure I should put it on a network drive as it would increase the network traffic a lot...

    As for my question about updating the excel sheet periodically, I was thinking about making a timer in my managed code and update excel sheet when timer elapses....

    Thanks,


  • VSTO 2003 basics