SpeadSkin causes crash

Posted by: kbj on 19 December 2017, 12:29 pm EST

    • Post Options:
    • Link

    Posted 19 December 2017, 12:29 pm EST

    I create a custom SpreadSkin which I use on multiple ‘Spreads’ in many projects and have run into a weird exception. If I close a form that contains a workbook that has had the SpreadSkin applied to it, any further use of that SpreadSkin causes a crash with a:

    An unhandled exception of type ‘System.NullReferenceException’ occurred in GrapeCity.Spreadsheet.Win.dll

    Object reference not set to an instance of an object.


    error

    In the included example:

    1. press the Form1 button which creates and shows the Form2
    2. close the Form2
    3. press the Form1 button to create a new Form2

    This is a critical bug that is holding back the launch of at least 2 projects.

    wbSkin.zip

  • Posted 20 December 2017, 2:20 am EST

    . . . . More on the KillerSkin!

    If any NamedStyle contains a color that is NOT an:

    IsKnownColor: True or

    IsNamedColor: True or

    IsSystemColor: True

    will cause an Exception if it is applied after being applied previously on a spread in a from that has been closed.

    System.NullReferenceException: ‘Object reference not set to an instance of an object.’

    I have included a killer skin that is identical to the Pre-Defined Office2007 skin with the only difference being that the default style backcolor has been set to a custom color.

    if you apply this skin to a spread in a form and then close the form, the skin will cause the above exception if applied to any other spread.

  • Posted 20 December 2017, 2:21 am EST

    . . . Here’s the skinKillerSkin2.zip

  • Posted 21 December 2017, 1:13 am EST

    Hello,

    I am able to replicate this issue at my end and reported it to the development team as a bug. The tracking id for this issue is 251928.

    I will let you know once I get any update one this.

    Thanks,

    Deepak Sharma

  • Posted 26 December 2017, 9:21 pm EST

    Hello,

    As per the development team this issue will be fixed in next maintenance release of Spread v11.0.

    In the mean time you can use the workaround of on form event closing of Form2, we can clear for NamedStyles of FpSpread1 like this:

    Private Sub Form2_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing

    FpSpread1.NamedStyles.Clear()

    End Sub

    Thanks,

    Deepak Sharma

  • Posted 27 December 2017, 1:59 am EST

    Hi Deepak,

    I tested the workaround and it did the job.

    Do you have any idea when the maintenance release will take place?

    Much thanks,

    Kingman

  • Posted 27 December 2017, 6:26 pm EST

    Hello,

    Great to know that the suggested solution worked for you. Next service pack of Spread v11.0 is scheduled to be release in April next year.

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels