locked
VSTO 2008 get_Range() error - COMException - Exception from HRESULT: 0x800A03EC RRS feed

  • Question

  • Hi All,

    I am getting the HRESULT error in worksheet.get_Range() method and the strange thing is that is only happens in few systems.Just wondering if we need any excel settings for this.

    ---------------------------------------------------------------------------------------------------------

    code:

    Excel.Range rngCell = null;

    string strCell=”14:14,16:16,33:33,50:50,51:51,60:60,64:64,69:69,71:71,85:85,87:87,89:89,94:94,108:108,110:110,

    115:115,120:120,122:122,133:133,139:139,140:140,147:147,154:154,156:156,160:160,172:172,173:173,175:175,

    185:185,197:197,198:198,201:201,204:204,208:208,209:209”;

    rngCell = ws.get_Range(strCell, Type.Missing); //Code throws error here.ws is worksheet object.

    ---------------------------------------------------------------------------------------------------------

    Basically here I am trying to get a hold of multiple discontinuous cells which is present in strCell and I always make sure the length of this string will not exceed 255.

    And one more thing we can eliminate,it can not be excel locale issue as I have taken care of that.

    Thanks!

    Deb




    Thursday, March 31, 2011 6:24 PM

Answers

  • Hi Eric,

    Yes I checked in the system where we have the problem.

    Not sure what is going wrong. Looks like the problem occurs when I pass collection of discontinuous rows to get_Range ().

    It seems I need to pass it one by one in a loop. E.g.: 14:14 then16:16 …

    Deb

    • Marked as answer by DebNet Friday, April 1, 2011 11:49 PM
    Friday, April 1, 2011 11:46 PM

All replies

  • I think you need to check your trust center settings.  See here: http://support.microsoft.com/kb/282830/

    HTH,

    Eric

    Thursday, March 31, 2011 6:38 PM
  • Hi Eric,

    Thanks for the reply. I have checked and the trust center settings looks correct in the system,but still I face the issue.Any other recommendation?

    Deb

    Friday, April 1, 2011 6:19 PM
  • Did you check the systems that you had the problem with, or a system that didn't have the problem?  I know it sounds like a silly question, but it seems the only answer given that the search I did on the error only came up with that answer... so if it doesn't work, I'm stumped.  Sorry,

    Cheers,

    Eric

    Friday, April 1, 2011 9:00 PM
  • Hi Eric,

    Yes I checked in the system where we have the problem.

    Not sure what is going wrong. Looks like the problem occurs when I pass collection of discontinuous rows to get_Range ().

    It seems I need to pass it one by one in a loop. E.g.: 14:14 then16:16 …

    Deb

    • Marked as answer by DebNet Friday, April 1, 2011 11:49 PM
    Friday, April 1, 2011 11:46 PM