Edit

Share via


Excel.SettingsChangedEventArgs interface

Provides information about the setting that raised the settings changed event

Remarks

[ API set: ExcelApi 1.4 ]

Examples

async function registerSettingsChangedHandler() {
    await Excel.run(async (context) => {
        // Register the onChanged setting event handler on the workbook.
        const settings = context.workbook.settings; 
        settings.onSettingsChanged.add(onChangedSetting);
        await context.sync();
    });
}

async function onChangedSetting(args: Excel.SettingsChangedEventArgs) {
    await Excel.run(async (context) => {
        const changedSetting = args.settings.getItem("NeedsReview");
        changedSetting.load("value");

        // Must sync with the context in the EventArgs object, 
        // not the context that Office passes to Excel.run. 
        await args.settings.context.sync();

        console.log("Setting value is: " + changedSetting.value);
        await context.sync();
    });
} 

Properties

settings

Gets the Setting object that represents the binding that raised the settings changed event

Property Details

settings

Gets the Setting object that represents the binding that raised the settings changed event

settings: Excel.SettingCollection;

Property Value

Remarks

[ API set: ExcelApi 1.4 ]