Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Excel & C# NullReference Error when trying to set Range.Value2

When trying to assign a string to the Value2 property of a Range:

WorksheetA.get_Range("A1",Type.Missing).Value2=cur Value.Trim();

I'm getting this error message:
Object reference not set to an instance of an object.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default Excel & C# NullReference Error when trying to set Range.Value2

Also, the Range is not null, it is the Value2 object that is null. The
mystery is how to ensure that the Value2 object is not null.

"Chuck" wrote:

When trying to assign a string to the Value2 property of a Range:

WorksheetA.get_Range("A1",Type.Missing).Value2=cur Value.Trim();

I'm getting this error message:
Object reference not set to an instance of an object.

Any suggestions?

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
Excel NPV initial cost in value1 and first year return in value2? Johanna Excel Worksheet Functions 3 September 12th 06 11:12 PM
Range.Value2 is failing for lenghty strings Naresh Mirkhelkar Excel Programming 4 June 9th 06 02:54 PM
Merged cells Value2 property Sandrina Excel Programming 1 February 6th 06 02:58 PM
Lookup Value2 Len Excel Programming 11 April 17th 05 11:50 AM
Activecell.value or value2? Sirin Excel Programming 2 November 22nd 04 12:01 PM


All times are GMT +1. The time now is 08:59 AM.

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"