473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

calling excel function LinEst from VB

Hi

I am trying to call the excel function linest from VB using automation.

the call
Slope1 =
Excel.WorksheetFunction.Index(Excel.WorksheetFunct ion.LinEst(y, x),1)

works fine as long as x is a one dimensional array.

But I need to do regression analysis for a multidimensional array (e.g.
I have x1,x2,x3,...,xn independent variables in the regression.)

so when I define x as say
dim x (10,2) as double

I get an error messages
"unable to get the linest property of the worksheet function class"

anyone know how to use linest for a multidimensioanl array ?

Thanks

Dec 25 '05 #1
1 6306
One thing you could do is to run the function/Sub in Excel. You can
invoke the Excel Sub from Access remotely. XLobj.Application.Run
"SubLinEst". In your Excel Sub you write out the results of LinEst to
an Excel Sheet. Then read the results in the Excel Sheet from Access.
You can use ADO for that. Or you can use automation and read cell by
cell (if there are not a lot of cells).

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Dec 25 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bob Murdoch | last post by:
I have an ASP application that calls a COM function to create a custom report as an Excel file. This works in a synchronous fashion, as long as the report does not take too long to create. If...
3
by: Gal merom | last post by:
I would like to run a function of one access file from another access/excel file, How can i do that? For example: I want to write a procedure in Excel VB that will call another function in an...
1
by: Scott P | last post by:
I am looking for a way to use several Excel functions (e.g. LINEST, LOGEST and RSQ) in C#. Do Microsoft or any third parties offer good tools to enable the use of such functions from within C#...
8
by: Rob Kellow | last post by:
Hello, I'm working on an application for use within my company on our intranet that will be used to gather some information and store some of the info in a SQL Server database and the rest of the...
0
by: Gunther | last post by:
Hi, I have tried the example from the KB article 817248 (http://support.microsoft.com/kb/817248/en-us) in Visual Basic AND in C# with ..NET Framework 2.0: <ComClass(ComClass1.ClassId,...
6
by: RB Smissaert | last post by:
Made a C++ dll with MS VC6 and trying to call the dll from Excel VBA. This is the code in the .cpp file: #include "stdafx.h" #include <string> #include <math.h> using namespace std;
1
by: Jaime Leivers | last post by:
Here's a median function in access that you can call in any query. You could change this to any excel function you wanted. Most people can find the windows help file that says how to call an excel...
3
by: keirnus | last post by:
Hello once again... I made a function in Excel. The function does some error checking within the Excel file. To be easy for me, I want my code in MS Access to simply call the function in Excel....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.