.net application with an excel interface  
Author Message
bilalso





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

Hi,

I am converting an Excel spreadsheet used by stock traders to a .net application.
I want them to give ability to set up new worksheets in the application and perform other Excel operations such as writing expressions to display new values based on values in other cells. Users basically like to calculate and display new ratios based on market values, I want to give them the ability to calculate and display whatever ratios or information they want from the core set of market information I provide them.

Basically, what I am trying to achieve is to display an Excel sheet in my .net application, be able to populate and update the excel sheet from the values I get from variety of sources, such as database, events, and other files..The cells in excel sheet will be updated very frequently as the application is tied to live market data and most importantly I want to give them ability to create and display new ratios using expressions of excel from the market information I provide to them in the excel sheet.

Thanks,



Visual Studio Tools for Office37  
 
 
Andrew Whitechapel - MSFT





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

You say you want to "display an Excel sheet in my .NET application", and this is achievable - to a very limited degree - by using say the webbrowser control or the dsoframer control, but probably not the best way to go.

Instead, you should be considering a VSTO document-level customization. In this model, you use Excel directly as the UI, and put managed code behind the worksheet. This way, you have full access to all of Excel's regular functionality both through the UI and also through the exposed OM.

As to specifics, your requirement to update the sheet with dynamic market data can be achieved by databinding named ranges to a suitable data source (which might be a database, or web service, or any suitable custom business object).

There's a lot of documentation online to get you started:

http://msdn2.microsoft.com/en-us/library/e7ezs44a.aspx

http://msdn2.microsoft.com/en-us/library/d7f63219.aspx


 
 
bilalso





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

Thanks,

I am looking into it, but before I actually start developing it I have an important question to ask....

If I develop the app using VSTO, I believe user will still be able to make changes in the excel sheet embedded in my app....What if I have to recompile the application and redeploy it Are we going to lose all the changes user made in the excel sheet


 
 
Andrew Whitechapel - MSFT





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

The situation is the same as with any software. If you deploy the solution with some set of initial data, then the user changes the data, it will no longer match the data that you installed. So, if you then want to deploy a new version, you'll be starting again with your chosen initial data. If you want to include the user's changed data in your new version, you have to find some way to do that. This becomes an issue if you have multiple users with different data sets. This is a standard problem of software development, not specific to VSTO.

However, VSTO does provide a simple mechanism to avoid this standard problem. Remember that the VSTO codebehind assemblies are not embedded in the document, so you can update the assemblies independently of the document. All you need to do is deploy the new assemblies - you don't need to redeploy the document.

The VSTO runtime even includes an automatic update feature. That is, when Office loads the solution, the VSTO runtime will check for updated assemblies and use those in place of the original ones. You get this feature regardless of whether you deploy the assemblies to the local machine or to some network share. Of course, if you deploy to a network share, you can thereby automatically update a large number of users without having to touch each of their machines.


 
 
bilalso





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

Thanks,

VSTO can be used with VS2005 only, correct or I can use it with VS 2003 as well Can I build Excel application using VS2003


 
 
Cindy Meister





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

There is also a VSTO for VS 2003, version 1.0 and it can be used to build an Excel appliction. You can use that, but not the current version 2.0 of VSTO; that's VS 2005 specific. Note that VSTO for VS 2003 does NOT have much of the 2.0 functionality. For example, it doesn't support actions panes or Windows Forms controls. (Instead, it has support for ActiveX controls from the Office Controls Toolbox toolbar. Also, there's no "Designer" for the Office documents in the VS 2003 IDE. The documents have to be constructed first, in Excel (or Word). There are also differences with how the projects are loaded.)

 
 
bilalso





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

Thanks Cindy,

Actually there is an existing VBA application written with Excel 2000. Currently we have Office 2000 installed on all machines.

1) Does VSTO with VS 2003 work with Excel 2000 I think it only works with office 2003 but I just need to confirm.

2) If it does, will I be able to add another worksheet in existing VBA application using VSTO with VS 2003

Thanks,


 
 
Cindy Meister





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

No, VSTO (no version) will work with any Office application earlier than 2003.

Note that you can automate earlier versions of Office using .NET, and write COM Addins. You just can't use VSTO solutions.

The answer to (2) is therefore "no" for Excel 2000. It would be "Yes" however, for Excel 2003 because the VSTO solution is actually a workbook, that can contain multiple Excel sheets.



 
 
Daison





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

I have to generate excel reports using asp.net . Currently we have Office 2000 installed on all client machines .

1) If I develop an office excel solution using VSTO in Vs.net 2003 having excel 2003 insatlled  in web server , Does it open the excel files on excel 2000 client machines for the asp.net web application

2) Does client machine needs .net framework installed to display excel reports for the asp.net web application


 
 
Cindy Meister





PostPosted: Visual Studio Tools for Office, .net application with an excel interface Top

asp.net can generate Excel reports for Excel 2000. It can use VSTO as long as Excel 2003 is installed on the machine where the reports are being generated. But

1. It makes little sense to use VSTO if you want to create the workbooks without user interaction. The you may as well use plain automation. (Note, however, that Microsoft does NOT recommend or support automating Office applications in a server environment!)

2. While Excel 2000 would probably be able to open any VSTO file (as Excel 2000 and 2003 share the same file format), the VSTO technology will NOT run. So the .NET framework would not need to be present.

Tip: It would be better to post as a separate, new question. Otherwise it's possible that no one will see that you're not simply replying to the existing messages.