Use Excel as Maath Engine for VS.NET

A

andrew

I am trying to use the Excel object to perform
calculations within a VB.NET program.
I set an Excel object, pass a string argument to its
evaluate method and all seems to work OK until I try and
pass an array.
i.e

this works when S= "cos(3.673/4)/exp(-3.33)"
Dim xL As New Excel.Application
Dim B As String
B = xL._Evaluate(S).ToString

this doesn't when S = "Sum({1,2,3,4,5})
Dim xL As New Excel.Application
Dim B As String
B = xL._Evaluate(S).ToString

Any one got ideas???
 
R

Rob Bovey

Hi Andrew,

The following works fine for me:

MessageBox.Show(xlApp.Evaluate("SUM({1,2,3,4,5})").ToString)

where xlApp is an running instance of the Excel Application object.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top