Re: string array cell size limit?

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Apr 4, 2:23 pm, "Bren" <b...@xxxxxxxxxxx> wrote:
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 astringwhose 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 astringarray

range.Value = StringArray ' this assigns thestringarray 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:
atSystem.RuntimeType.ForwardCallToInvokeMember(StringmemberName,BindingFlagsflags,Objecttarget,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


Check to see if any of your cells start with a character that intiates
a macro. I had that problem and found a cell starting with a hyphen
that caused this error.

-Mohamed


.



Relevant Pages

  • Re: Mshflexgrid to Excel -
    ... >> In the mshflexgrid i have now managed to get my dates showing ... >> The code i use goes over each cell and should duplicate that cell to ... >> an excel cell, the code is. ... >> exported exactly how it is shown in the grid? ...
    (microsoft.public.vb.general.discussion)
  • Getting cell value of composed address
    ... I have a grid of data where I am trying to apply conditional ... The logic is that, for every cell in a column, if it's ... conditional formatting. ... work because Excel appears to require addresses to be hardcoded. ...
    (microsoft.public.excel)
  • RE: insert cell
    ... The whole concept of Excel is it's grid ... cell without a row and column! ... In previous versions we had the ability to shift left or right I can't ...
    (microsoft.public.excel.misc)
  • Re: How can I copy text from Excel into Word without the grid?
    ... without the grid, but will maintain a link to the source data in Excel. ... How it displays - content, formatting, etc. - is ... gridlines you see inWord aren't borders, ...
    (microsoft.public.word.docmanagement)
  • Re: PWA - Export Grid to Excel not working
    ... When you click Export Grid to Excel on the Project Center page in Microsoft ... As well as in the SP1 for Project Pro Microsoft Knowledge Base Article - ... The Export Grid to Excel feature in PWA causes an error message, ...
    (microsoft.public.project.pro_and_server)