# Save Executed Event in RadSpreadsheet

## Environment

<table>
<tbody>
<tr>
<th scope="row">Product</th>
<td>RadSpreadsheet for WPF</td>
</tr>
<tr>
<th scope="row">Version</th>
<td>2024.3.924</td>
</tr>
</tbody>
</table>

## Description

How to listen for the save file command of RadSpreadsheet for WPF.

## Solution

To do this, you can subscribe to the `UICommandExecuted` event of the `RadWorksheetEditor` object.

```C#
	RadWorksheetEditor editorCache = null;

	private void RadSpreadsheet_ActiveSheetEditorChanged(object? sender, EventArgs e)
	{
		var spreadsheet = (RadSpreadsheet)sender;
		if (editorCache != null)
		{
			editorCache.UICommandExecuted -= ActiveSheetEditor_UICommandExecuted;
		}
		if (spreadsheet.ActiveWorksheetEditor != null)
		{
			spreadsheet.ActiveWorksheetEditor.UICommandExecuted += ActiveSheetEditor_UICommandExecuted;
		}
		editorCache = spreadsheet.ActiveWorksheetEditor;
	}

	private void ActiveSheetEditor_UICommandExecuted(object? sender, Telerik.Windows.Controls.Spreadsheet.Commands.UICommandExecutedEventArgs e)
	{
		var editor = (RadWorksheetEditor)sender;
		if (editor.Commands.SaveFile == e.Command)
		{
		  // execute your code here
		}
	}
```
