Microsoft Excel

Use Microsoft Excel in Sim to manage worksheets, table rows, and cell ranges in .xlsx workbooks on OneDrive for Business or SharePoint. Discover worksheets and tables, add or update records, write formulas and number formats, apply formatting, and calculate workbook results.

Choose a Microsoft account with access to the workbook. SharePoint site browsing requires the Sites.Read.All permission; reconnect an existing account to consent to the added scope. Enter a workbook ID and, for SharePoint, its drive ID, or use the selectors.

Use Create Session when several operations work on the same workbook. Turn on Save Changes to persist edits, or leave it off for a temporary copy. Pass the returned sessionId to every operation in that sequence, then close the session. Requests without a session ID save their changes directly. List operations return one page and expose top and skip; increase skip by the page count until fewer than top items are returned. Range reads should use an explicit bounded range for large worksheets; returned cell values retain the existing trimming of trailing empty rows and columns, while formula and format matrices describe the full returned range.

OAuth scopes

Sim requests these scopes when someone connects a Microsoft Excel account. For a self-hosted deployment, register your own app with the provider using the settings below. See Integrations and OAuth for setup.

SettingValue
Redirect URI<NEXT_PUBLIC_APP_URL>/api/auth/oauth2/callback/microsoft-excel
Environment variablesMICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET
ScopeDescription
openidStandard authentication
profileAccess profile information
emailAccess email address
Files.ReadRead OneDrive files
Files.ReadWriteRead and write OneDrive files
Sites.Read.AllRead documents and list items in all SharePoint sites
offline_accessAccess account when not using the application

Use the block

Read and write values and formulas, manage worksheets and table rows, format ranges, and calculate workbooks with persistent or temporary sessions.

Actions

Add to Microsoft Excel Table

Add new rows to a Microsoft Excel table

Inputs and outputs

Input

ParameterTypeRequiredDescription
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook containing the table (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
tableNamestringYesThe name of the table to add rows to (e.g., "Table1", "SalesTable")
indexnumberNoZero-based insertion index. Omit to append at the end.
valuesarrayNoData rows in table column order, without headers (e.g., [["Value", 30]]). Object rows are also accepted in key order for compatibility. Omit to add a blank row.

Output

ParameterTypeDescription
indexnumberIndex of the first row that was added
valuesarrayTwo-dimensional cell values; cells contain strings, numbers, booleans, or null.
metadataobjectSpreadsheet metadata
↳ spreadsheetIdstringThe ID of the spreadsheet
↳ spreadsheetUrlstringURL to access the spreadsheet

Add Worksheet to Microsoft Excel

Create a new worksheet (sheet) in a Microsoft Excel workbook

Inputs and outputs

Input

ParameterTypeRequiredDescription
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the Excel workbook to add the worksheet to (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
worksheetNamestringNoThe name of the new worksheet (e.g., "Sales Q1", "Data"). Omit for an automatic name. Supplied names must be unique within the workbook and cannot exceed 31 characters

Output

ParameterTypeDescription
worksheetobjectDetails of the newly created worksheet
↳ idstringThe unique ID of the worksheet
↳ namestringThe name of the worksheet
↳ positionnumberThe zero-based position of the worksheet
↳ visibilitystringThe visibility state of the worksheet (Visible/Hidden/VeryHidden)
metadataobjectSpreadsheet metadata
↳ spreadsheetIdstringThe ID of the spreadsheet
↳ spreadsheetUrlstringURL to access the spreadsheet

Microsoft Excel List Worksheets

List Worksheets in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
topnumberNoPage size ($top), from 1 to 1000. Defaults to 100.
skipnumberNoNumber of items to skip ($skip). Defaults to 0. Increase by the returned count to read the next page.

Output

ParameterTypeDescription
worksheetsarrayWorksheets in this page.
↳ idstringStable worksheet identifier.
↳ namestringWorksheet display name.
↳ positionnumberZero-based position in the workbook.
↳ visibilitystringVisible, Hidden, or VeryHidden.
nextLinkstringProvider continuation link, when supplied. This tool pages with top and skip; it does not follow links automatically.
countnumberNumber of items returned in this page, not a total count.

Microsoft Excel Get Worksheet

Get Worksheet in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
sheetNamestringYesWorksheet ID or name within the workbook.

Output

ParameterTypeDescription
worksheetobjectWorksheet properties.
↳ idstringStable worksheet identifier.
↳ namestringWorksheet display name.
↳ positionnumberZero-based position in the workbook.
↳ visibilitystringVisible, Hidden, or VeryHidden.

Microsoft Excel Update Worksheet

Update Worksheet in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
sheetNamestringYesWorksheet ID or name within the workbook.
namestringNoNew worksheet name, unique within the workbook (maximum 31 characters).
positionnumberNoNew zero-based worksheet position.
visibilitystringNoVisible, Hidden, or VeryHidden.

Output

ParameterTypeDescription
worksheetobjectWorksheet properties.
↳ idstringStable worksheet identifier.
↳ namestringWorksheet display name.
↳ positionnumberZero-based position in the workbook.
↳ visibilitystringVisible, Hidden, or VeryHidden.

Microsoft Excel List Tables

List Tables in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
topnumberNoPage size ($top), from 1 to 1000. Defaults to 100.
skipnumberNoNumber of items to skip ($skip). Defaults to 0. Increase by the returned count to read the next page.

Output

ParameterTypeDescription
tablesarrayTables in this page.
↳ idstringStable table identifier.
↳ namestringTable name.
↳ showHeadersbooleanWhether the header row is visible.
↳ showTotalsbooleanWhether the totals row is visible.
↳ stylestringBuilt-in or custom table style.
↳ highlightFirstColumnbooleanWhether the first column has special formatting.
↳ highlightLastColumnbooleanWhether the last column has special formatting.
↳ showBandedColumnsbooleanWhether alternating columns are formatted differently.
↳ showBandedRowsbooleanWhether alternating rows are formatted differently.
↳ showFilterButtonbooleanWhether header filter buttons are visible.
↳ legacyIdstringOpaque legacy identifier used by older Excel clients.
nextLinkstringProvider continuation link, when supplied. This tool pages with top and skip; it does not follow links automatically.
countnumberNumber of items returned in this page, not a total count.

Microsoft Excel Get Table

Get Table in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
tableNamestringYesTable ID or name within the workbook.

Output

ParameterTypeDescription
tableobjectTable properties.
↳ idstringStable table identifier.
↳ namestringTable name.
↳ showHeadersbooleanWhether the header row is visible.
↳ showTotalsbooleanWhether the totals row is visible.
↳ stylestringBuilt-in or custom table style.
↳ highlightFirstColumnbooleanWhether the first column has special formatting.
↳ highlightLastColumnbooleanWhether the last column has special formatting.
↳ showBandedColumnsbooleanWhether alternating columns are formatted differently.
↳ showBandedRowsbooleanWhether alternating rows are formatted differently.
↳ showFilterButtonbooleanWhether header filter buttons are visible.
↳ legacyIdstringOpaque legacy identifier used by older Excel clients.

Microsoft Excel Update Table

Update Table in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
tableNamestringYesTable ID or name within the workbook.
namestringNoNew unique table name.
showHeadersbooleanNoWhether to show the header row.
showTotalsbooleanNoWhether to show the totals row.
stylestringNoBuilt-in table style (TableStyleLight1–21, TableStyleMedium1–28, TableStyleDark1–11) or a custom style already in the workbook.

Output

ParameterTypeDescription
tableobjectTable properties.
↳ idstringStable table identifier.
↳ namestringTable name.
↳ showHeadersbooleanWhether the header row is visible.
↳ showTotalsbooleanWhether the totals row is visible.
↳ stylestringBuilt-in or custom table style.
↳ highlightFirstColumnbooleanWhether the first column has special formatting.
↳ highlightLastColumnbooleanWhether the last column has special formatting.
↳ showBandedColumnsbooleanWhether alternating columns are formatted differently.
↳ showBandedRowsbooleanWhether alternating rows are formatted differently.
↳ showFilterButtonbooleanWhether header filter buttons are visible.
↳ legacyIdstringOpaque legacy identifier used by older Excel clients.

Microsoft Excel Delete Table

Delete Table in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
tableNamestringYesTable ID or name within the workbook.

Output

ParameterTypeDescription
deletedbooleanWhether the table was deleted.

Microsoft Excel List Table Rows

List Table Rows in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
topnumberNoPage size ($top), from 1 to 1000. Defaults to 100.
skipnumberNoNumber of items to skip ($skip). Defaults to 0. Increase by the returned count to read the next page.
tableNamestringYesTable ID or name within the workbook.

Output

ParameterTypeDescription
rowsarrayTable Rows in this page.
↳ indexnumberZero-based row index.
↳ valuesarrayTwo-dimensional cell values; cells contain strings, numbers, booleans, or null.
nextLinkstringProvider continuation link, when supplied. This tool pages with top and skip; it does not follow links automatically.
countnumberNumber of items returned in this page, not a total count.

Microsoft Excel Get Table Row

Get Table Row in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
tableNamestringYesTable ID or name within the workbook.
indexnumberYesZero-based table row index. Indexes can change when rows are inserted or deleted.

Output

ParameterTypeDescription
indexnumberZero-based table row index.
valuesarrayTwo-dimensional cell values; cells contain strings, numbers, booleans, or null.

Microsoft Excel Update Table Row

Update Table Row in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
tableNamestringYesTable ID or name within the workbook.
indexnumberYesZero-based table row index. Indexes can change when rows are inserted or deleted.
valuesarrayYesExactly one row as a two-dimensional array, in table column order. Use null to leave a cell unchanged.

Output

ParameterTypeDescription
indexnumberZero-based table row index.
valuesarrayTwo-dimensional cell values; cells contain strings, numbers, booleans, or null.

Microsoft Excel Delete Table Row

Delete Table Row in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
tableNamestringYesTable ID or name within the workbook.
indexnumberYesZero-based table row index. Indexes can change when rows are inserted or deleted.

Output

ParameterTypeDescription
deletedbooleanWhether the table row was deleted.

Microsoft Excel Create Session

Create Session in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
persistChangesbooleanYesTrue saves changes; false creates a temporary workbook copy whose changes are discarded when the session ends.

Output

ParameterTypeDescription
sessionIdstringPass this ID as sessionId on subsequent workbook operations.
persistChangesbooleanWhether changes in this session are saved.

Microsoft Excel Refresh Session

Refresh Session in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringYesWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.

Output

ParameterTypeDescription
refreshedbooleanWhether the workbook session was refreshed.

Microsoft Excel Close Session

Close Session in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringYesWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.

Output

ParameterTypeDescription
closedbooleanWhether the workbook session was closed.

Microsoft Excel Calculate

Calculate in a Microsoft Excel workbook.

Inputs and outputs

Input

ParameterTypeRequiredDescription
spreadsheetIdstringYesWorkbook drive item ID.
driveIdstringNoDrive ID for SharePoint or another drive. Defaults to the signed-in user’s OneDrive. Excel workbook APIs require a business account.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
calculationTypestringYesRecalculate recalculates dirty cells; Full recalculates all cells; FullRebuild rebuilds dependencies and recalculates all cells.

Output

ParameterTypeDescription
calculatedbooleanWhether workbook calculation completed.

Read from Microsoft Excel V2

Read data from a specific sheet in a Microsoft Excel spreadsheet

Inputs and outputs

Input

ParameterTypeRequiredDescription
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook to read from (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
sheetNamestringYesThe name of the sheet/tab to read from (e.g., "Sheet1", "Sales Data")
cellRangestringNoThe cell range to read (e.g., "A1:D10"). If not specified, reads the entire used range.

Output

ParameterTypeDescription
valuesarrayTwo-dimensional cell values; cells contain strings, numbers, booleans, or null.
addressLocalstringLocalized range address.
cellCountnumberCell count in the returned range.
columnCountnumberColumn count in the returned range.
columnHiddenbooleanWhether all columns are hidden.
columnIndexnumberZero-based first column index.
formulasarrayA1 formulas for the full returned range.
formulasLocalarrayLocalized A1 formulas for the full returned range.
formulasR1C1arrayR1C1 formulas for the full returned range.
hiddenbooleanWhether all cells are hidden.
numberFormatarrayNumber format codes for the full returned range.
rowCountnumberRow count in the returned range.
rowHiddenbooleanWhether all rows are hidden.
rowIndexnumberZero-based first row index.
textarrayFormatted text for the full returned range.
valueTypesarrayCell value types for the full returned range.
sheetNamestringName of the sheet that was read
rangestringThe range that was read
metadatajsonSpreadsheet metadata including ID and URL
↳ spreadsheetIdstringMicrosoft Excel spreadsheet ID
↳ spreadsheetUrlstringSpreadsheet URL

Write to Microsoft Excel V2

Write data to a specific sheet in a Microsoft Excel spreadsheet

Inputs and outputs

Input

ParameterTypeRequiredDescription
formulasarrayNoA1-style formulas as a two-dimensional array. Null leaves a cell unchanged.
formulasLocalarrayNoA1-style formulas in the user locale as a two-dimensional array. Null leaves a cell unchanged.
formulasR1C1arrayNoR1C1-style formulas as a two-dimensional array. Null leaves a cell unchanged.
numberFormatarrayNoExcel number format codes as a two-dimensional array. Null leaves a cell unchanged.
columnHiddenbooleanNoHide all columns in the target range.
rowHiddenbooleanNoHide all rows in the target range.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook to write to (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
sheetNamestringYesThe name of the sheet/tab to write to (e.g., "Sheet1", "Sales Data")
cellRangestringNoThe cell range to write to (e.g., "A1:D10", "A1"). Defaults to "A1" if not specified.
valuesarrayNoThe data to write as a 2D array (used exactly as provided) or array of objects. For object rows, their keys become a header row. Use a 2D array to write data without added headers.

Output

ParameterTypeDescription
valuesarrayTwo-dimensional cell values; cells contain strings, numbers, booleans, or null.
addressLocalstringLocalized range address.
cellCountnumberCell count in the returned range.
columnCountnumberColumn count in the returned range.
columnHiddenbooleanWhether all columns are hidden.
columnIndexnumberZero-based first column index.
formulasarrayA1 formulas for the full returned range.
formulasLocalarrayLocalized A1 formulas for the full returned range.
formulasR1C1arrayR1C1 formulas for the full returned range.
hiddenbooleanWhether all cells are hidden.
numberFormatarrayNumber format codes for the full returned range.
rowCountnumberRow count in the returned range.
rowHiddenbooleanWhether all rows are hidden.
rowIndexnumberZero-based first row index.
textarrayFormatted text for the full returned range.
valueTypesarrayCell value types for the full returned range.
updatedRangestringRange of cells that were updated
updatedRowsnumberNumber of rows updated
updatedColumnsnumberNumber of columns updated
updatedCellsnumberNumber of cells updated
metadatajsonSpreadsheet metadata including ID and URL
↳ spreadsheetIdstringMicrosoft Excel spreadsheet ID
↳ spreadsheetUrlstringSpreadsheet URL

Clear Microsoft Excel Range

Clear the values and/or formatting of a range in a Microsoft Excel worksheet

Inputs and outputs

Input

ParameterTypeRequiredDescription
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
sheetNamestringNoThe name of the worksheet (e.g., "Sheet1"). If omitted, the range must use the combined "Sheet1!A1:B2" format.
rangestringYesThe cell range to clear (e.g., "A1:D10" or "Sheet1!A1:D10")
applyTostringNoWhat to clear: "All", "Formats", or "Contents". Defaults to "All".

Output

ParameterTypeDescription
clearedbooleanWhether the range was cleared
rangestringThe range that was cleared
applyTostringWhat was cleared (All, Formats, or Contents)
metadataobjectSpreadsheet metadata
↳ spreadsheetIdstringThe ID of the spreadsheet
↳ spreadsheetUrlstringURL to access the spreadsheet

Format Microsoft Excel Range

Apply fill color and/or font formatting to a range in a Microsoft Excel worksheet

Inputs and outputs

Input

ParameterTypeRequiredDescription
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
sheetNamestringNoThe name of the worksheet (e.g., "Sheet1"). If omitted, the range must use the combined "Sheet1!A1:B2" format.
rangestringYesThe cell range to format (e.g., "A1:D10" or "Sheet1!A1:D10")
fillColorstringNoBackground fill color as an HTML hex code (e.g., "#FFFF00").
fontBoldbooleanNoWhether the font is bold.
fontItalicbooleanNoWhether the font is italic.
fontColorstringNoFont color as an HTML hex code (e.g., "#FF0000").
fontSizenumberNoFont size in points (e.g., 12).
fontUnderlinestringNoNone, Single, Double, SingleAccountant, or DoubleAccountant.
fontNamestringNoFont name (e.g., "Calibri").

Output

ParameterTypeDescription
formattedbooleanWhether the formatting was applied
rangestringThe range that was formatted
fillobjectThe applied fill, or null if no fill was set
↳ colorstringThe applied fill color
fontobjectThe applied font properties, or null if no font was set
↳ boldbooleanWhether the font is bold
↳ italicbooleanWhether the font is italic
↳ colorstringThe font color
↳ namestringThe font name
↳ underlinestringUnderline style.
↳ sizenumberThe font size in points
metadataobjectSpreadsheet metadata
↳ spreadsheetIdstringThe ID of the spreadsheet
↳ spreadsheetUrlstringURL to access the spreadsheet

Create Microsoft Excel Table

Create a new table over a range of cells in a Microsoft Excel workbook

Inputs and outputs

Input

ParameterTypeRequiredDescription
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
addressstringYesThe range address for the table data source (e.g., "Sheet1!A1:D5"). If no sheet name is included, the active sheet is used.
hasHeadersbooleanNoWhether the first row of the range contains column headers. Defaults to true.

Output

ParameterTypeDescription
tableobjectTable properties.
↳ idstringStable table identifier.
↳ namestringTable name.
↳ showHeadersbooleanWhether the header row is visible.
↳ showTotalsbooleanWhether the totals row is visible.
↳ stylestringBuilt-in or custom table style.
↳ highlightFirstColumnbooleanWhether the first column has special formatting.
↳ highlightLastColumnbooleanWhether the last column has special formatting.
↳ showBandedColumnsbooleanWhether alternating columns are formatted differently.
↳ showBandedRowsbooleanWhether alternating rows are formatted differently.
↳ showFilterButtonbooleanWhether header filter buttons are visible.
↳ legacyIdstringOpaque legacy identifier used by older Excel clients.
metadataobjectSpreadsheet metadata
↳ spreadsheetIdstringThe ID of the spreadsheet
↳ spreadsheetUrlstringURL to access the spreadsheet

Delete Microsoft Excel Worksheet

Delete a worksheet (sheet) from a Microsoft Excel workbook

Inputs and outputs

Input

ParameterTypeRequiredDescription
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
worksheetNamestringYesThe name of the worksheet to delete (e.g., "Sheet1", "Old Data")

Output

ParameterTypeDescription
deletedbooleanWhether the worksheet was deleted
worksheetNamestringThe name of the deleted worksheet
metadataobjectSpreadsheet metadata
↳ spreadsheetIdstringThe ID of the spreadsheet
↳ spreadsheetUrlstringURL to access the spreadsheet

Sort Microsoft Excel Range

Sort a range or table by one or more fields in a Microsoft Excel worksheet

Inputs and outputs

Input

ParameterTypeRequiredDescription
sortFieldsarrayNoSort conditions [{key, ascending, sortOn, color, dataOption, icon}]. Overrides sortColumn/sortAscending; ascending defaults to true for each condition; key is a zero-based offset, sortOn is Value, CellColor, FontColor, or Icon; dataOption is Normal or TextAsNumber; icon contains set and index.
sortMethodstringNoChinese character ordering: PinYin or StrokeCount.
orientationstringNoRows (default) or Columns. Applies only to range sorts.
sessionIdstringNoWorkbook session ID from Create Session. Omit for a sessionless request that saves changes.
spreadsheetIdstringYesThe ID of the spreadsheet/workbook (e.g., "01ABC123DEF456")
driveIdstringNoThe ID of the drive containing the spreadsheet. Required for SharePoint files. If omitted, uses the signed-in user’s default OneDrive. Excel workbook APIs require a business account.
tableNamestringNoThe name of the table to sort. When provided, the table is sorted and range/sheetName are ignored.
sheetNamestringNoThe name of the worksheet (e.g., "Sheet1"). Used for range sorts when the range does not include a sheet name.
rangestringNoThe cell range to sort (e.g., "A1:D10" or "Sheet1!A1:D10"). Required when no table name is provided.
sortColumnnumberNoZero-based sort key: column offset for Rows orientation, row offset for Columns orientation.
sortAscendingbooleanNoWhether to sort in ascending order. Defaults to true.
hasHeadersbooleanNoWhether the range has a header row that should be excluded from sorting. Only applies to range sorts. Defaults to false.
matchCasebooleanNoWhether casing affects string ordering. Defaults to false.

Output

ParameterTypeDescription
sortedbooleanWhether the sort was applied
targetstringThe range or table name that was sorted
sortColumnnumberThe zero-based key of the first sort condition
ascendingbooleanWhether the sort was ascending
metadataobjectSpreadsheet metadata
↳ spreadsheetIdstringThe ID of the spreadsheet
↳ spreadsheetUrlstringURL to access the spreadsheet