Importing from Excel cell with more than 1024 chars

Hi,

We have a dxl script that imports an xls spreadsheet. All is OK until the length of the text in a particular cell exceeds 1024 chars, after which the string returned from

string szText
      oleGet(objCell, "Text", szText)


is truncated to 1024 chars.
Is this a DOORS limitation/feature ? Anybody any ideas how to get round the problem without having to resort to importing as csv ?

The corresponding export function olePut()doesn't appear to have thos 1024 char limitation.

Thanks, Paul


SystemAdmin - Wed Jul 21 08:25:45 EDT 2010

Re: Importing from Excel cell with more than 1024 chars
rmoskwa - Wed Jul 21 14:09:34 EDT 2010

I assume that you are using Excel. I am using Excel 2000 SP-3
Open Excel Help->answer Wizard and search for limitations. Select Microsoft Excel specifications.
You will see that the "length of cell contents (text)" is 32,767 characters, but only 1024 display in a cell.
This may be the cause of the problem.

Re: Importing from Excel cell with more than 1024 chars
Mathias Mamsch - Wed Jul 21 16:32:28 EDT 2010

You are using the text property of the cell which will give you what is displayed. If you for example change the formatting (e.g. for a date content) from date to number, then the text property will reflect that change (even though you did not change the value of the cell). As already stated a cell will only display 1024 characters of a string. Therefore the text property will give you 1024 characters too.

My guess is if you use the value property instead of text, then you will get the whole content (up to 32k characters). Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Importing from Excel cell with more than 1024 chars
SystemAdmin - Thu Jul 22 01:09:33 EDT 2010

Mathias Mamsch - Wed Jul 21 16:32:28 EDT 2010
You are using the text property of the cell which will give you what is displayed. If you for example change the formatting (e.g. for a date content) from date to number, then the text property will reflect that change (even though you did not change the value of the cell). As already stated a cell will only display 1024 characters of a string. Therefore the text property will give you 1024 characters too.

My guess is if you use the value property instead of text, then you will get the whole content (up to 32k characters). Regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Thanks Mathias, that did the trick

Regards, Paul