View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] temp@deltasero.com is offline
external usenet poster
 
Posts: 2
Default C# Value2 intermittent exception

The following article has some discussion on why strings of a certain
size (912 chars or greater) will result in the Value2 command causing
an exception.

http://support.microsoft.com/kb/818808

The good news--this problem is NOT intermittent.

The bad news--part of my code had this as a repetitive problem. I
fixed this one.
I've got others (where the string length is NOT the problem) that
continue to fail (intermittently).



microsoft.public.excel.programming wrote:
Read all the way through the following link ... may be helpful ...

http://blogs.msdn.com/eric_carter/ar...06/225989.aspx


And then, embedded in the following is a small section on VALUE2 ...

http://msdn2.microsoft.com/en-us/lib...ffice.11).aspx

And the summary from the above article:

Summary
Microsoft Office Word and Microsoft Office Excel expose rich programming
models, but those object models were originally written to be consumed
by VBA clients. Visual Basic .NET, even with Option Strict On, can
handle most of the requirements of the Office object models. Consuming
those object models with C# requires a bit more care. When writing
applications using Visual Studio Tools for the Microsoft Office System
and C#, keep in mind that you'll often need to make concessions to the
differences between the languages, watching for optional parameters,
parameterized properties, Variants, and late binding. Once you
internalize the types of issues you'll face, writing C# code that
interacts with Office becomes no more difficult than writing Visual
Basic .NET code.


Good luck ...

JimP

*** Sent via Developersdex http://www.developersdex.com ***