activities
latest
false
UiPath logo, featuring letters U and I in white

Productivity activities

Last updated Mar 13, 2026

WriteRange

Writes a DataTable variable to a specified Excel workbook cell range.

Namespace: UiPath.MicrosoftOffice365.Activities.Api

Assembly: UiPath.MicrosoftOffice365.Activities.Api (in UiPath.MicrosoftOffice365.Activities.Api.dll)

Syntax

void WriteRange(
	IWorkbook workbook,
	IRange range,
	DataTable data,
	bool hasHeaders = true,
	RangeWriteMode writeMode = RangeWriteMode.Overwrite,
	int insertRowPosition = 0
)
void WriteRange(
	IWorkbook workbook,
	IRange range,
	DataTable data,
	bool hasHeaders = true,
	RangeWriteMode writeMode = RangeWriteMode.Overwrite,
	int insertRowPosition = 0
)

Parameters

workbook IWorkbook : The Excel workbook to use.

range IRange : The range to write in.

data DataTable : The data in the DataTable to be written in the workbook.

hasHeaders Boolean (Optional) : Set to True if the first row in the range represents a header row.

writeMode RangeWriteMode (Optional) : Specifies how to add the data to the specified range.

insertRowPosition Int32 (Optional) : The row index position where to insert the row.

  • Syntax
  • Parameters

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated