OfficeIMO

API Reference

Command

Set-OfficeExcelCell

Namespace PSWriteOffice
Inputs
None
Outputs
System.Object

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: Coordinates

Parameters

Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
Formula String optionalposition: namedpipeline: False
Formula text (without leading =).
NumberFormat String optionalposition: namedpipeline: False
Number format code to apply.
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.
Value Object optionalposition: namedpipeline: False
Cell value to assign.

Outputs

System.Object

Set-OfficeExcelCell [-Address <String>] [-Formula <String>] [-NumberFormat <String>] [-Value <Object>] [<CommonParameters>]
#
Parameter set: Address

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address (e.g., A1, C5).
Formula String optionalposition: namedpipeline: False
Formula text (without leading =).
NumberFormat String optionalposition: namedpipeline: False
Number format code to apply.
Value Object optionalposition: namedpipeline: False
Cell value to assign.

Outputs

System.Object