+ Reply to Thread
Results 1 to 8 of 8

Help! Single cell owning > 1024 chars caused exception

Hybrid View

  1. #1
    dotNeter
    Guest

    Help! Single cell owning > 1024 chars caused exception

    I found that if a single cell includes greater than 1024 chars, using
    property Range.FormulaR1C1to read content from the cell must cause an
    exception, say

    System.Runtime.InteropServices.COMException (0x800A03EC): Exception
    from HRESULT
    : 0x800A03EC
    at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
    BindingFla
    gs flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
    at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()

    However, same code, just after keeping chars less than 1024 in a single
    cell, everything is ok.

    Is it a Microsoft.Office.Interop.Excel implemenation error?
    I used MS Excel 11.0 Object Library.

    Thx in advance!


  2. #2
    Peter T
    Guest

    Re: Help! Single cell owning > 1024 chars caused exception

    Cell's formula property cannot handle more than 1024. However a cell can
    contain, but not display, up to 32k characters. Maybe you can read the
    ..Value property.

    Regards,
    Peter T

    "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    news:1152516763.399795.30680@s13g2000cwa.googlegroups.com...
    > I found that if a single cell includes greater than 1024 chars, using
    > property Range.FormulaR1C1to read content from the cell must cause an
    > exception, say
    >
    > System.Runtime.InteropServices.COMException (0x800A03EC): Exception
    > from HRESULT
    > : 0x800A03EC
    > at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
    > BindingFla
    > gs flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
    > at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()
    >
    > However, same code, just after keeping chars less than 1024 in a single
    > cell, everything is ok.
    >
    > Is it a Microsoft.Office.Interop.Excel implemenation error?
    > I used MS Excel 11.0 Object Library.
    >
    > Thx in advance!
    >




  3. #3
    dotNeter
    Guest

    Re: Help! Single cell owning > 1024 chars caused exception

    Thx Peter.

    I want the return type is Object, that is more easier for future
    processing. So I can't use Cells property to retreive the data. I'll
    have a try.

    BTW, I can't find any documentation describing Formula property cannot
    handle more than 1024 chars. Where is it? Undocumented?

    Peter T wrote:
    > Cell's formula property cannot handle more than 1024. However a cell can
    > contain, but not display, up to 32k characters. Maybe you can read the
    > .Value property.
    >
    > Regards,
    > Peter T
    >
    > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > news:1152516763.399795.30680@s13g2000cwa.googlegroups.com...
    > > I found that if a single cell includes greater than 1024 chars, using
    > > property Range.FormulaR1C1to read content from the cell must cause an
    > > exception, say
    > >
    > > System.Runtime.InteropServices.COMException (0x800A03EC): Exception
    > > from HRESULT
    > > : 0x800A03EC
    > > at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
    > > BindingFla
    > > gs flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
    > > at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()
    > >
    > > However, same code, just after keeping chars less than 1024 in a single
    > > cell, everything is ok.
    > >
    > > Is it a Microsoft.Office.Interop.Excel implemenation error?
    > > I used MS Excel 11.0 Object Library.
    > >
    > > Thx in advance!
    > >



  4. #4
    Peter T
    Guest

    Re: Help! Single cell owning > 1024 chars caused exception

    > BTW, I can't find any documentation describing Formula property cannot
    > handle more than 1024 chars. Where is it? Undocumented?


    In 100's of threads in this ng and officially elsewhere, see for yourself in
    VBA

    Sub test()
    Dim rng As Range, s$

    Set rng = ActiveCell

    s = "X"
    For i = 1 To 10
    s = s & s
    Next

    Stop ' step through with F8
    rng = s

    MsgBox Len(rng.FormulaR1C1) ' len 1024 no error
    rng = s & "a"
    MsgBox Len(rng.FormulaR1C1) ' ERROR cos len 1025

    'drag cursor down to next line & continue with F8
    rng = s & s & s & s & s & s & s & s
    MsgBox Len(rng.Value) ' 8192

    End Sub

    Regards,
    Peter T

    "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    news:1152539113.956831.318140@b28g2000cwb.googlegroups.com...
    > Thx Peter.
    >
    > I want the return type is Object, that is more easier for future
    > processing. So I can't use Cells property to retreive the data. I'll
    > have a try.
    >
    > BTW, I can't find any documentation describing Formula property cannot
    > handle more than 1024 chars. Where is it? Undocumented?
    >
    > Peter T wrote:
    > > Cell's formula property cannot handle more than 1024. However a cell can
    > > contain, but not display, up to 32k characters. Maybe you can read the
    > > .Value property.
    > >
    > > Regards,
    > > Peter T
    > >
    > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > news:1152516763.399795.30680@s13g2000cwa.googlegroups.com...
    > > > I found that if a single cell includes greater than 1024 chars, using
    > > > property Range.FormulaR1C1to read content from the cell must cause an
    > > > exception, say
    > > >
    > > > System.Runtime.InteropServices.COMException (0x800A03EC): Exception
    > > > from HRESULT
    > > > : 0x800A03EC
    > > > at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
    > > > BindingFla
    > > > gs flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
    > > > at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()
    > > >
    > > > However, same code, just after keeping chars less than 1024 in a

    single
    > > > cell, everything is ok.
    > > >
    > > > Is it a Microsoft.Office.Interop.Excel implemenation error?
    > > > I used MS Excel 11.0 Object Library.
    > > >
    > > > Thx in advance!
    > > >

    >




  5. #5
    dotNeter
    Guest

    Re: Help! Single cell owning > 1024 chars caused exception

    Thx again.
    Another question.
    Which Office versions does this 1024 limitation apply to? All? And all
    languages?

    thx.

    Peter T wrote:
    > > BTW, I can't find any documentation describing Formula property cannot
    > > handle more than 1024 chars. Where is it? Undocumented?

    >
    > In 100's of threads in this ng and officially elsewhere, see for yourself in
    > VBA
    >
    > Sub test()
    > Dim rng As Range, s$
    >
    > Set rng = ActiveCell
    >
    > s = "X"
    > For i = 1 To 10
    > s = s & s
    > Next
    >
    > Stop ' step through with F8
    > rng = s
    >
    > MsgBox Len(rng.FormulaR1C1) ' len 1024 no error
    > rng = s & "a"
    > MsgBox Len(rng.FormulaR1C1) ' ERROR cos len 1025
    >
    > 'drag cursor down to next line & continue with F8
    > rng = s & s & s & s & s & s & s & s
    > MsgBox Len(rng.Value) ' 8192
    >
    > End Sub
    >
    > Regards,
    > Peter T
    >
    > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > news:1152539113.956831.318140@b28g2000cwb.googlegroups.com...
    > > Thx Peter.
    > >
    > > I want the return type is Object, that is more easier for future
    > > processing. So I can't use Cells property to retreive the data. I'll
    > > have a try.
    > >
    > > BTW, I can't find any documentation describing Formula property cannot
    > > handle more than 1024 chars. Where is it? Undocumented?
    > >
    > > Peter T wrote:
    > > > Cell's formula property cannot handle more than 1024. However a cell can
    > > > contain, but not display, up to 32k characters. Maybe you can read the
    > > > .Value property.
    > > >
    > > > Regards,
    > > > Peter T
    > > >
    > > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > > news:1152516763.399795.30680@s13g2000cwa.googlegroups.com...
    > > > > I found that if a single cell includes greater than 1024 chars, using
    > > > > property Range.FormulaR1C1to read content from the cell must cause an
    > > > > exception, say
    > > > >
    > > > > System.Runtime.InteropServices.COMException (0x800A03EC): Exception
    > > > > from HRESULT
    > > > > : 0x800A03EC
    > > > > at System.RuntimeType.ForwardCallToInvokeMember(String memberName,
    > > > > BindingFla
    > > > > gs flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
    > > > > at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()
    > > > >
    > > > > However, same code, just after keeping chars less than 1024 in a

    > single
    > > > > cell, everything is ok.
    > > > >
    > > > > Is it a Microsoft.Office.Interop.Excel implemenation error?
    > > > > I used MS Excel 11.0 Object Library.
    > > > >
    > > > > Thx in advance!
    > > > >

    > >



  6. #6
    Peter T
    Guest

    Re: Help! Single cell owning > 1024 chars caused exception

    > Which Office versions does this 1024 limitation apply to? All?

    Excel 97 - 2003.
    Not sure about the new beta, earlier versions might be less, I forget. Even
    manually you cannot enter or edit a formula starting with an "=" over 1024.

    FWIW a formula can contain over 1024, but you cannot read or write it.

    Regards,
    Peter T

    "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    news:1152670420.307254.217900@i42g2000cwa.googlegroups.com...
    > Thx again.
    > Another question.
    > Which Office versions does this 1024 limitation apply to? All? And all
    > languages?
    >
    > thx.
    >
    > Peter T wrote:
    > > > BTW, I can't find any documentation describing Formula property cannot
    > > > handle more than 1024 chars. Where is it? Undocumented?

    > >
    > > In 100's of threads in this ng and officially elsewhere, see for

    yourself in
    > > VBA
    > >
    > > Sub test()
    > > Dim rng As Range, s$
    > >
    > > Set rng = ActiveCell
    > >
    > > s = "X"
    > > For i = 1 To 10
    > > s = s & s
    > > Next
    > >
    > > Stop ' step through with F8
    > > rng = s
    > >
    > > MsgBox Len(rng.FormulaR1C1) ' len 1024 no error
    > > rng = s & "a"
    > > MsgBox Len(rng.FormulaR1C1) ' ERROR cos len 1025
    > >
    > > 'drag cursor down to next line & continue with F8
    > > rng = s & s & s & s & s & s & s & s
    > > MsgBox Len(rng.Value) ' 8192
    > >
    > > End Sub
    > >
    > > Regards,
    > > Peter T
    > >
    > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > news:1152539113.956831.318140@b28g2000cwb.googlegroups.com...
    > > > Thx Peter.
    > > >
    > > > I want the return type is Object, that is more easier for future
    > > > processing. So I can't use Cells property to retreive the data. I'll
    > > > have a try.
    > > >
    > > > BTW, I can't find any documentation describing Formula property cannot
    > > > handle more than 1024 chars. Where is it? Undocumented?
    > > >
    > > > Peter T wrote:
    > > > > Cell's formula property cannot handle more than 1024. However a cell

    can
    > > > > contain, but not display, up to 32k characters. Maybe you can read

    the
    > > > > .Value property.
    > > > >
    > > > > Regards,
    > > > > Peter T
    > > > >
    > > > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > > > news:1152516763.399795.30680@s13g2000cwa.googlegroups.com...
    > > > > > I found that if a single cell includes greater than 1024 chars,

    using
    > > > > > property Range.FormulaR1C1to read content from the cell must cause

    an
    > > > > > exception, say
    > > > > >
    > > > > > System.Runtime.InteropServices.COMException (0x800A03EC):

    Exception
    > > > > > from HRESULT
    > > > > > : 0x800A03EC
    > > > > > at System.RuntimeType.ForwardCallToInvokeMember(String

    memberName,
    > > > > > BindingFla
    > > > > > gs flags, Object target, Int32[] aWrapperTypes, MessageData&

    msgData)
    > > > > > at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()
    > > > > >
    > > > > > However, same code, just after keeping chars less than 1024 in a

    > > single
    > > > > > cell, everything is ok.
    > > > > >
    > > > > > Is it a Microsoft.Office.Interop.Excel implemenation error?
    > > > > > I used MS Excel 11.0 Object Library.
    > > > > >
    > > > > > Thx in advance!
    > > > > >
    > > >

    >




  7. #7
    Peter T
    Guest

    Re: Help! Single cell owning > 1024 chars caused exception

    > Which Office versions does this 1024 limitation apply to? All?

    Excel 97 - 2003.
    Not sure about the new beta, earlier versions might be less, I forget. Even
    manually you cannot enter or edit a formula starting with an "=" over 1024.

    FWIW a formula can contain over 1024, but you cannot read or write it.

    Regards,
    Peter T

    "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    news:1152670420.307254.217900@i42g2000cwa.googlegroups.com...
    > Thx again.
    > Another question.
    > Which Office versions does this 1024 limitation apply to? All? And all
    > languages?
    >
    > thx.
    >
    > Peter T wrote:
    > > > BTW, I can't find any documentation describing Formula property cannot
    > > > handle more than 1024 chars. Where is it? Undocumented?

    > >
    > > In 100's of threads in this ng and officially elsewhere, see for

    yourself in
    > > VBA
    > >
    > > Sub test()
    > > Dim rng As Range, s$
    > >
    > > Set rng = ActiveCell
    > >
    > > s = "X"
    > > For i = 1 To 10
    > > s = s & s
    > > Next
    > >
    > > Stop ' step through with F8
    > > rng = s
    > >
    > > MsgBox Len(rng.FormulaR1C1) ' len 1024 no error
    > > rng = s & "a"
    > > MsgBox Len(rng.FormulaR1C1) ' ERROR cos len 1025
    > >
    > > 'drag cursor down to next line & continue with F8
    > > rng = s & s & s & s & s & s & s & s
    > > MsgBox Len(rng.Value) ' 8192
    > >
    > > End Sub
    > >
    > > Regards,
    > > Peter T
    > >
    > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > news:1152539113.956831.318140@b28g2000cwb.googlegroups.com...
    > > > Thx Peter.
    > > >
    > > > I want the return type is Object, that is more easier for future
    > > > processing. So I can't use Cells property to retreive the data. I'll
    > > > have a try.
    > > >
    > > > BTW, I can't find any documentation describing Formula property cannot
    > > > handle more than 1024 chars. Where is it? Undocumented?
    > > >
    > > > Peter T wrote:
    > > > > Cell's formula property cannot handle more than 1024. However a cell

    can
    > > > > contain, but not display, up to 32k characters. Maybe you can read

    the
    > > > > .Value property.
    > > > >
    > > > > Regards,
    > > > > Peter T
    > > > >
    > > > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > > > news:1152516763.399795.30680@s13g2000cwa.googlegroups.com...
    > > > > > I found that if a single cell includes greater than 1024 chars,

    using
    > > > > > property Range.FormulaR1C1to read content from the cell must cause

    an
    > > > > > exception, say
    > > > > >
    > > > > > System.Runtime.InteropServices.COMException (0x800A03EC):

    Exception
    > > > > > from HRESULT
    > > > > > : 0x800A03EC
    > > > > > at System.RuntimeType.ForwardCallToInvokeMember(String

    memberName,
    > > > > > BindingFla
    > > > > > gs flags, Object target, Int32[] aWrapperTypes, MessageData&

    msgData)
    > > > > > at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()
    > > > > >
    > > > > > However, same code, just after keeping chars less than 1024 in a

    > > single
    > > > > > cell, everything is ok.
    > > > > >
    > > > > > Is it a Microsoft.Office.Interop.Excel implemenation error?
    > > > > > I used MS Excel 11.0 Object Library.
    > > > > >
    > > > > > Thx in advance!
    > > > > >
    > > >

    >




  8. #8
    Peter T
    Guest

    Re: Help! Single cell owning > 1024 chars caused exception

    > Which Office versions does this 1024 limitation apply to? All?

    Excel 97 - 2003.
    Not sure about the new beta, earlier versions might be less, I forget. Even
    manually you cannot enter or edit a formula starting with an "=" over 1024.

    FWIW a formula can contain over 1024, but you cannot read or write it.

    Regards,
    Peter T

    "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    news:1152670420.307254.217900@i42g2000cwa.googlegroups.com...
    > Thx again.
    > Another question.
    > Which Office versions does this 1024 limitation apply to? All? And all
    > languages?
    >
    > thx.
    >
    > Peter T wrote:
    > > > BTW, I can't find any documentation describing Formula property cannot
    > > > handle more than 1024 chars. Where is it? Undocumented?

    > >
    > > In 100's of threads in this ng and officially elsewhere, see for

    yourself in
    > > VBA
    > >
    > > Sub test()
    > > Dim rng As Range, s$
    > >
    > > Set rng = ActiveCell
    > >
    > > s = "X"
    > > For i = 1 To 10
    > > s = s & s
    > > Next
    > >
    > > Stop ' step through with F8
    > > rng = s
    > >
    > > MsgBox Len(rng.FormulaR1C1) ' len 1024 no error
    > > rng = s & "a"
    > > MsgBox Len(rng.FormulaR1C1) ' ERROR cos len 1025
    > >
    > > 'drag cursor down to next line & continue with F8
    > > rng = s & s & s & s & s & s & s & s
    > > MsgBox Len(rng.Value) ' 8192
    > >
    > > End Sub
    > >
    > > Regards,
    > > Peter T
    > >
    > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > news:1152539113.956831.318140@b28g2000cwb.googlegroups.com...
    > > > Thx Peter.
    > > >
    > > > I want the return type is Object, that is more easier for future
    > > > processing. So I can't use Cells property to retreive the data. I'll
    > > > have a try.
    > > >
    > > > BTW, I can't find any documentation describing Formula property cannot
    > > > handle more than 1024 chars. Where is it? Undocumented?
    > > >
    > > > Peter T wrote:
    > > > > Cell's formula property cannot handle more than 1024. However a cell

    can
    > > > > contain, but not display, up to 32k characters. Maybe you can read

    the
    > > > > .Value property.
    > > > >
    > > > > Regards,
    > > > > Peter T
    > > > >
    > > > > "dotNeter" <Buddhist.CHinA@gmail.com> wrote in message
    > > > > news:1152516763.399795.30680@s13g2000cwa.googlegroups.com...
    > > > > > I found that if a single cell includes greater than 1024 chars,

    using
    > > > > > property Range.FormulaR1C1to read content from the cell must cause

    an
    > > > > > exception, say
    > > > > >
    > > > > > System.Runtime.InteropServices.COMException (0x800A03EC):

    Exception
    > > > > > from HRESULT
    > > > > > : 0x800A03EC
    > > > > > at System.RuntimeType.ForwardCallToInvokeMember(String

    memberName,
    > > > > > BindingFla
    > > > > > gs flags, Object target, Int32[] aWrapperTypes, MessageData&

    msgData)
    > > > > > at Microsoft.Office.Interop.Excel.Range.get_FormulaR1C1()
    > > > > >
    > > > > > However, same code, just after keeping chars less than 1024 in a

    > > single
    > > > > > cell, everything is ok.
    > > > > >
    > > > > > Is it a Microsoft.Office.Interop.Excel implemenation error?
    > > > > > I used MS Excel 11.0 Object Library.
    > > > > >
    > > > > > Thx in advance!
    > > > > >
    > > >

    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1