Share via


Ewa.EwaControl.remove_workbookChanged(function)

Applies to: apps for SharePoint | Excel Services | SharePoint Server 2013

Removes the specified event handler from the [workbookChanged] event.

Ewa.EwaControl.remove_workbookChanged(function);

Parameters

function

The event handler to unsubscribe from the event.

Return Value

None.

Example

The following code example shows how to unsubscribe the specified event handler from the [workbookChanged] event. The code example assumes that you are working with an Excel Web Access Web Part on SharePoint Server 2013.

<script type="text/javascript">
     
var ewa = null;
    
// Add event handler for onload event.
if (window.attachEvent) 
{ 
    window.attachEvent("onload", ewaOnPageLoad);    
} 
else 
{ 
    window.addEventListener("DOMContentLoaded", ewaOnPageLoad, false); 
}

// Add event handler for applicationReady event.
function ewaOnPageLoad()
{
    if (typeof (Ewa) != "undefined")
    {
        Ewa.EwaControl.add_applicationReady(ewaApplicationReady);
    }
    else
    {
        alert("Error - the EWA JS is not loaded.");
    }
}

function ewaApplicationReady()
{
    ewa = Ewa.EwaControl.getInstances().getItem(0);

    // Add event handler for workbookChanged event.
    ewa.add_workbookChanged(wkbookChanged);
}

function myFunction()
{
    // Remove event handler from workbookChanged event.
    ewa.remove_workbookChanged(wkbookChanged);

    // ...
}
</script>

See also

Reference

Ewa.EwaControl.add_workbookChanged(function)

Ewa.EwaControl Object