Dreaded 911 cell character limitation

M

mdengler

Hello everyone,

I have a C# method that uses an object array to programmatically
populate an Excel spreadsheet. The problem I’m faced with is a
0x800A03EC abend when trying to add more than 911 characters to a
single cell.

********* Code snippet that creates the array

foreach(DataRow row in MyDataTable.Rows)
{
col_index=0;
foreach(object item in row.ItemArray)
{
//create an array of row values.
objData[row_index,col_index] = item.ToString();
col_index++;
}
row_index++;
}

********* Code snippet that populates the spreadsheet

objRange.Value2 = objData; //this is where the error occurs
//objRange.set_Value(Missing.Value, objData); //tried this… same
error


I've been searching the www for an answer and the only solution I can
find is to truncate the string to 911 characters. I would prefer to
not take this approach if I don't have to. I have to believe there is
a way to programmatically add more than 911 characters because I'm able
to manually copy 32k characters into an excel spreadsheet cell. Has
anyone else overcome this problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top