Spreadsheet control crashes on some spreadsheets

Not Answered This post has 0 verified answers | 5 Replies | 2 Followers Thread's RSS feed.

tomdnaughton
Points 210
Replied On: Mon, Oct 9 2017 1:21 PM Reply

When I load certain spreadsheets from a hard drive, the spreadsheet control crashes when the code attempts to set the workbook.

If I hover over the workbook variable after this line ...

Infragistics.Documents.Excel.Workbook workbook = Infragistics.Documents.Excel.Workbook.Load(FilePath);

... everything seems fine.  The name of the workbook is correct, the number of worksheets, their names, etc.  The workbook also opens fine in Excel with no error message.

But as soon as this line executes in my code ...

sprdSource.Workbook = workbook;

.. the control blows up.  I get a big red X in the control, and I have to quit the application.  This doesn't seem to be an error that we can trap in a try-catch block  either.   The error from the .NET framework says object reference not set to an instance of an object.

Again, this only happens with some spreadsheets.  Some are .xls, some are .xlsx.

Spreadsheet control is 16.1.20161.1000.

Thanks.

  • Post Points: 20

All Replies

Mike Bowshewicz
Points 11,590
Infragistics Employee
Replied On: Mon, Oct 9 2017 5:20 PM Reply

Hello,

In order to test this out, I would like a copy of any xls file you are loading that crashes. Please let me know if you would prefer not to upload this to the public forum and I will create a private case.

A common cause of the red X is use of a control on a background thread. Are you using any threading in your application?

Sincerely,

Mike B
Software Developer

  • Post Points: 35
tomdnaughton
Points 210
Replied On: Mon, Oct 9 2017 5:24 PM Reply

Hi, Mike --

No, there's no threading on the form where it crashes.  I'll send you a sample Excel file, but yes, let's make it a private case.

Thanks.

  • Post Points: 5
tomdnaughton
Points 210
Replied On: Tue, Oct 10 2017 12:00 PM Reply

How do I proceed with a private case?  Is there something I need to do at my end?

  • Post Points: 20
Mike Bowshewicz
Points 11,590
Infragistics Employee
Replied On: Wed, Oct 11 2017 9:49 AM Reply

Hello,

I've created a private case to receive the file. You should see the private case under the Support Activity page on our site. There should be an option to upload the file there.

Please let me know if you have any questions.

Sincerely,

Mike B
Software Developer

  • Post Points: 20
tomdnaughton
Points 210
Replied On: Thu, Oct 12 2017 11:49 AM Reply

Okay, I uploaded in there.

Thanks.

  • Post Points: 5
Page 1 of 1 (6 items) | RSS