Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
RandomEngineer
 
Posts: n/a
Default 'null reference' when trying to use WorksheetFunction from C#

I've got Microsoft.Office.Interop.Excel referenced in a .NET 2.0 class. No
problems with compilation but at runtime, I get 'null reference' errors when
trying to use an Excel function.

For example,
using Excel = Microsoft.Office.Interop.Excel;
Excel.WorksheetFunction wsFunction = null;
double weibull = wsFunction.Weibull(1, 2, 3, true);

I receive the 'null reference' error on the wsFunction.Weibull call.

I've also tried...
internal Excel.Application ThisApplication
{
get { return thisApplication; }
}
private Excel.Application thisApplication = null;
double weibull = thisApplication.WorksheetFunction.Weibull(1, 2, 3, true);

and receive the same error when trying to use a WorksheetFunction call.

Any ideas?


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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
Null values in charts and how to override the goal seek functionality Sarge Charts and Charting in Excel 1 January 27th 06 03:57 AM
Referencing cell in another sheet yields null? [email protected] Excel Worksheet Functions 4 November 18th 05 01:11 AM
Flexible Cell Reference Brandt Excel Discussion (Misc queries) 5 June 2nd 05 10:23 PM
Absolute Worksheet reference number Tony M Excel Discussion (Misc queries) 4 March 21st 05 06:10 PM


All times are GMT +1. The time now is 02:05 PM.

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

About Us

"It's about Microsoft Excel"