GetValue returns "Nothing"

Posted by: john on 12 May 2020, 12:55 am EST

    • Post Options:
    • Link

    Posted 12 May 2020, 12:55 am EST

    I have a spreadsheet that I enter values into. If I try and use GetValue on any column that had nothing entered at the design stage I always get “Nothing” returned in the object. This is the same whether I have entered values into the spreadsheet or not.

    To keep it simple, here is some sample code…

      For Row = 1 To MaximumInputChannels
        o = frmSystemChannelsDefinition.FpsInputChannels.ActiveSheet.GetValue(Row - 1, 0)
        vValue = o.ToString()
    
        o = frmSystemChannelsDefinition.FpsInputChannels.ActiveSheet.GetValue(Row - 1, 1)
        vValue += o.ToString()
      Next Row
    

    The second call to GetValue always returns “Nothing” in o, even if the cell has a value I have entered.

  • Posted 12 May 2020, 1:28 am EST

    I will add that if I have values entered in any cell at design time then they are read back correctly. However, if values are entered into any cell at run time, then I get an error saying the cell has returned “Nothing”.

    If I use GetText rather than GetValue it returns an empty string

    I cannot understand why it has been made so difficult to use the Spreadsheet V13… compared to earlier versions?

    The idea of buying ready made components is to make our lives easier, not to have to spend hours, and even days trying to work out how to get a value from a cell. Please guys at GrapeCity, make this easier, or at least give working examples of how to carry out even the simplest of tasks. The help file has been no use at all to me, and I can find no example code on the website.

  • Posted 12 May 2020, 8:42 pm EST

    Hi

    I tested the GetText and GetValue properties and they are working fine with Spread.Net 13.45.20201.0. To them, I created a standalone application, assigned value programmatically and run-time, both) and the value returned was not nothing and correct. Please see attached application.

    So, the behavior you mention must be specific to your application code. Hence, I’d like to request for some sample code snippet.

    Thanks,

    Ruchir

    GetValue_SpreadWin.zip

  • Posted 13 May 2020, 3:44 am EST - Updated 30 September 2022, 4:32 am EST

    Hi,

    I included code snippet above.

    Since then I have had a more severe issue. I spent hours developing a Spreadsheet form yesterday for my application. When I loaded the project back into VS19 I get a completely blank Spreadsheet. When loaded into the editor the Sheet Settings are all grayed out - see attached image…

  • Posted 13 May 2020, 3:47 am EST

    By The Way, The sample you sent will not load into VS2019. So many missing references and files not found.

  • Posted 14 May 2020, 4:32 am EST

    Hello John,

    The behavior you mention is strange and shouldn’t happen. Is the same behavior occurring while opening the spread sheet in standalone SpreadDesigner application as well? It might be an issue with installation.

    For us to investigate better, could you please share the stripped down project/spreadsheet with us?

    Thanks,

    Ruchir

  • Posted 23 May 2020, 12:06 am EST

    I have re-installed the .NET version onto another PC and this issue has resolved.

Need extra support?

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

Learn More

Forum Channels