views:

225

answers:

3

I have an Excel spreadsheet template with data and a chart. I want to be able to publish (repeatably) the raw data to a web server using using a web service interface. I would like to do this with vanilla Excel--no add-ons or required ActiveX controls, etc.

I am open to suggestions on the web service technology: REST, etc.

Are there any built-in apis that do this? Could someone point me to the docs?

A: 

Yes, use the OLEDB driver and read the data from Excel directly. (This would not read the chart image, though).

Example.

Then you can expose that in any way you see fit. REST would be fine.

Cheeso
Actually I was looking for a way to connect to a web service from inside of an Excel template. I'm currently looking at using Visual Studio Tools for Office to allow a dotnet assembly from inside the spreadsheet. The dotnet code can then read the spreadsheet and talk to the web server.
Peter Stephens
Oh! Sorry, I misunderstood. Yes, VSTO will help you build what you describe.
Cheeso
A: 

Microsoft provides the ability to do this with Microsoft Excel Services - which are part of Office SharePoint Server.

SpreadsheetGear for .NET can be used in various ways to take advantage of Excel workbooks from ASP.NET (aspx pages or web services).

See the live ASP.NET samples which show how to generate Excel workbooks, generate images / dashboards from Excel charts and ranges, do Excel compatible calculations, etc...

You can download a free evaluation here.

Disclaimer: I own SpreadsheetGear LLC

Joe Erickson
Thanks for the tip. I'm not sure I want to use sharepoint though. I really want to use a vanilla ASP.NET website. I'm considering using VSTO to write code to read the spreadsheet and send the data to the web service. See the above comment.
Peter Stephens
A: 

After discussing the subject with a Microsoft developer evangelist (J Sawyer) I believe the best approach would be to use VSTO (Visual Studio Tools for Office). I would create a clickonce assembly that would interface directly with the Excel template, read the Excel data and push the data to a web service.

There doesn't seem to be any mechanism using just vanilla Excel and VBA.

Peter Stephens