string array cell size limit?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm using Excel automation in a VB.NET 2.0 WinForm application to
export an Xceed grid to an Excel document.

I've encounter an error when a grid column containing a Notes field
from the database has a string whose length exceeds 912 characters.

I'm putting the exported data into arrays and then assigning the
arrays to an Excel Range.

StringArray(iRow, 0) = gridCell.Value ' this puts a grid cell into an
element of a string array

range.Value = StringArray ' this assigns the string array to the
Excel Range

If the StringArray has an element with more that 912 characters in
length I get this error.


System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2146827284
Message="Exception from HRESULT: 0x800A03EC"
Source=""
StackTrace:
at System.RuntimeType.ForwardCallToInvokeMember(String
memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes,
MessageData& msgData)
at Microsoft.Office.Interop.Excel.Range.set_Value(Object
RangeValueDataType, Object )

What is causing the error?

I appreciate your help, and I'm thanking you in advance.

Bren

.



Relevant Pages

  • Excel ActiveX TextBox Question
    ... process the full string after the user hits "Enter". ... But in Excel I just get ... What is the syntax of a string array so that I can read in the data? ... What is the string compare function that I can use to compare 2 strings? ...
    (microsoft.public.excel.misc)
  • Drag and Drop CSV data into an Excel grid
    ... I'm trying to implement Drag and Drop so I can drop data into an Excel ... but for some reason I get garbage in the excel grid. ... where sb is a StringBuilder containing the exact string mentioned ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Need help with SeriesCollection Object Please !
    ... Well Peter your explanation of my questions make sense and are sound answers. ... You seem very experienced with Excel and VBA:) ... Function GetSourceSheet(sFmla As String, sWSname, sFile As String) As ... ran my code on certain other charts sometimes it would return ...
    (microsoft.public.excel.programming)
  • Re: Format Excel - Object required error
    ... tell excel to autofit the columns. ... Public Sub FormatXLReport(strPath As String, ... Dim blnExcelExists As Boolean ... Private Const SW_SHOWNORMAL = 1 ...
    (microsoft.public.access.modulesdaovba)
  • Re: XP and string paths
    ... > the "Lcase" function is suddenly no longer available to Excel? ... > that occurs because of Windows XP. ... > string functions that Excel uses has become ... > is the usual "missing reference" problem. ...
    (microsoft.public.excel.programming)