API Reference
Command
Set-OfficeExcelCell
Sets a cell value, formula, or number format within the current worksheet.
Remarks
Sets a cell value, formula, or number format within the current worksheet.
Examples
Write values to A1 and B1.
PS>ExcelSheet 'Data' { Set-OfficeExcelCell -Address 'A1' -Value 'Region'; Set-OfficeExcelCell -Row 1 -Column 2 -Value 'Revenue' }
Writes two headers in the first row.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Set-OfficeExcelCell [-Column <Nullable`1>] [-Formula <String>] [-NumberFormat <String>] [-Row <Nullable`1>] [-Value <Object>] [<CommonParameters>]#Parameter set:
CoordinatesParameters
- Column Nullable`1
- 1-based column index.
- Formula String
- Formula text (without leading =).
- NumberFormat String
- Number format code to apply.
- Row Nullable`1
- 1-based row index.
- Value Object
- Cell value to assign.
Outputs
System.Object
Set-OfficeExcelCell [-Address <String>] [-Formula <String>] [-NumberFormat <String>] [-Value <Object>] [<CommonParameters>]#Parameter set:
AddressParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Formula String
- Formula text (without leading =).
- NumberFormat String
- Number format code to apply.
- Value Object
- Cell value to assign.
Outputs
System.Object