views:

228

answers:

2

I am using LabVIEW to talk to Excel via its ActiveX interface.

For some reason after some time successfully writing to a spreadsheet I got this error when attempting to call the a function which does something with the range.

Sorry this question is so vague, but its because I am actually using another toolkit to take care of the Excel writing.

Anybody know if there is a lookup table for Excel ActiveX calls anywhere?

Thanks

+1  A: 

This error code means "Object Required."

It sounds like your toolkit might have a memory leak, or it is disposing of an object prematurely.

Robert Harvey
Premature release in my case was correct. Often objects depend from others. If you hold a Range and close the workbook the range comes from, then accessing the Range will cause this exception for example. Thanks this hint helped me.
jdehaan
A: 

It's possible that the range object isn't being handled properly in the toolkit. If this is NI's reporting toolkit, you can possibly open the sub-vi's and place probes to troubleshoot the error. (This may have changed, though. I haven't looked at it since it was re-written.)

The Excel functions exposed in LV are variously called "automation" or its "object model". You can find information on where to locate the help for it at http://support.microsoft.com/kb/q222101/. A number of the links from that page have pretty good text code samples that can be translated into LV code if you care to do so.

Of course, NI's site has a number of Excel examples at http://www.ni.com/analysis/excel.htm

Underflow
This is NI's toolkit, although it was re-written at its heart its still the same ActiveX calls.The thing that is bugging me is that this code was working fine for several weeks, and then just fell over. Its not really possible to probe as its in a built app and then several weeks into a test.My only thought is that in this particular bit of code the spreadsheet is kept open and written to multiple times. Perhaps something closed the sheet? This lead to this range object being invalid as the actual spreadsheet would not be open anymore so all references would be dead.???
Neil