Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default EXCEL As VS.NET Math Engine



I was trying to use excel as a math engine in a VB.NET application.

I used the following code snippet

Dim xL As New Excel.Application
Dim B As String

MsgBox(xL.Evaluate(B).ToString)

This works as long as the string value parsed to EXCEL doesn't exceed a
certain length (i.e. the string "AVEARGE({0,1,2......,82,83,84})"
worked. The string "AVEARGE({0,1,2......,82,83,84,85})" fails and gives
me the result -2146826273.

However when the same strings are used in the native EXCEL environment
they seem to work just fine.

I am using Visual Studio.NET and have loaded a references to both the
EXCEL 10.0 and OFFICE 10.0 object libraries.

I need to parse sets of data which may contain upward of 100 points, and
am interested in doing some further statistical manipulation on them
(such as percentiles, standard deviation etc). Does any one have any
suggestions on how I can get over this seeming limited string
caapability.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default EXCEL As VS.NET Math Engine

Hi Andrew,

Instead of trying to evaluate these arrays, why not put the data into a
range of cells on a worksheet and then use that range in your worksheet
function. This will remove any problems you have with too many numbers. For
example, =AVERAGE(A1:A1000) lets you average 1000 values (and that's just a
number I pulled out of the air, you can use much larger ranges than this).
This is really the way Excel is designed to work.

--
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 *


"andrew allan" wrote in message
...


I was trying to use excel as a math engine in a VB.NET application.

I used the following code snippet

Dim xL As New Excel.Application
Dim B As String

MsgBox(xL.Evaluate(B).ToString)

This works as long as the string value parsed to EXCEL doesn't exceed a
certain length (i.e. the string "AVEARGE({0,1,2......,82,83,84})"
worked. The string "AVEARGE({0,1,2......,82,83,84,85})" fails and gives
me the result -2146826273.

However when the same strings are used in the native EXCEL environment
they seem to work just fine.

I am using Visual Studio.NET and have loaded a references to both the
EXCEL 10.0 and OFFICE 10.0 object libraries.

I need to parse sets of data which may contain upward of 100 points, and
am interested in doing some further statistical manipulation on them
(such as percentiles, standard deviation etc). Does any one have any
suggestions on how I can get over this seeming limited string
caapability.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default EXCEL As VS.NET Math Engine

Hi Andrew,

You're probably reaching a 256 characters limit for a formula (to be
evaluated by Evaluate).

Why don't you generate your array in the following manner, using
Evaluate()'s array processing ability.

B="AVERAGE(ROW(1:85)-1)"
MsgBox(xL.Evaluate(B).ToString)

As you can see, the array is processed internaly (within the Evaluate).
This is just a hint on how to generate ascending numbers, for the general
rule (using cells to process data, instead of putting all the items into a
long string), follow Rob's answer.

Regards,

Daniel M.

"andrew allan" wrote in message
...


I was trying to use excel as a math engine in a VB.NET application.

I used the following code snippet

Dim xL As New Excel.Application
Dim B As String

MsgBox(xL.Evaluate(B).ToString)

This works as long as the string value parsed to EXCEL doesn't exceed a
certain length (i.e. the string "AVEARGE({0,1,2......,82,83,84})"
worked. The string "AVEARGE({0,1,2......,82,83,84,85})" fails and gives
me the result -2146826273.

However when the same strings are used in the native EXCEL environment
they seem to work just fine.

I am using Visual Studio.NET and have loaded a references to both the
EXCEL 10.0 and OFFICE 10.0 object libraries.

I need to parse sets of data which may contain upward of 100 points, and
am interested in doing some further statistical manipulation on them
(such as percentiles, standard deviation etc). Does any one have any
suggestions on how I can get over this seeming limited string
caapability.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seo , Search Engine Optimizer , Seo Search engine Optimization , search engine optimization services, SEO Consulting Se0 Guy Excel Worksheet Functions 0 March 8th 07 04:08 AM
Seo , Search Engine Optimizer , Seo Search engine Optimization , search engine optimization services, SEO Consulting Se0 Guy Excel Discussion (Misc queries) 0 March 8th 07 04:08 AM
Seo , Search Engine Optimizer , Seo Search engine Optimization , search engine optimization services, SEO Consulting Se0 Guy Setting up and Configuration of Excel 0 March 8th 07 04:08 AM
Seo , Search Engine Optimizer , Seo Search engine Optimization , search engine optimization services, SEO Consulting Se0 Guy Links and Linking in Excel 0 March 8th 07 04:08 AM
Seo , Search Engine Optimizer , Seo Search engine Optimization , search engine optimization services, SEO Consulting Se0 Guy Charts and Charting in Excel 0 March 8th 07 04:08 AM


All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"