How to Retrieve Clicked Cell Value in SpreadJS Using GC.Spread.Sheets.Events.In

Posted by: bruno.bueno on 21 September 2023, 10:35 pm EST

  • Posted 21 September 2023, 10:35 pm EST

    Hello fellow SpreadJS enthusiasts,

    I’m currently working on a project using SpreadJS, and I’m facing an issue related to the GC.Spread.Sheets.Events.InvalidOperation event. Specifically, I want to retrieve the value of the clicked cell when this event is triggered, but I’m not sure how to do it.

    Here’s the scenario:

    I have set up an event listener for the GC.Spread.Sheets.Events.InvalidOperation event in my SpreadJS application.

    When this event is fired, I need to access the value of the cell that was clicked by the user.

    My question is, how can I obtain the clicked cell value when handling the InvalidOperation event?

    I would greatly appreciate any guidance or examples from those who have experience with SpreadJS or have encountered a similar scenario. Please share your insights or code snippets if possible.

    Thank you in advance for your help!

    Best regards,


  • Posted 21 September 2023, 11:01 pm EST - Updated 24 September 2023, 3:42 pm EST

    Hi Bruno,

    The Invalid Operation is triggered by many actions like when trying to edit a locked cell in a protected sheet, when the drag drop is invalid, when drag fill is invalid, etc. You could refer to the following enumeration for different types of InvalidOperation:

    As per my understanding, you want to know the active cell(s) when the Event is triggered. You could use the following code snippet:

    spread.bind(GC.Spread.Sheets.Events.InvalidOperation, (sender, args) => {
        console.log("Invalid Operation");
        let sheet = args.sheet;
        let activeSelection = sheet.getSelections()[0];


    If it doesn’t satisfy your requirement, kindly let us know which operation you are performing so that we could help you accordingly. A video/gif of the operation would be really helpful. You could also fork the above sample, modify it and share it with us.


    InvalidOperation Event:

    getSelections method:



Need extra support?

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

Learn More

Forum Channels