OfficeIMO

API Reference

Command

New-OfficeExcel

Namespace PSWriteOffice
Inputs
None
Outputs
System.Object

Creates a new Excel workbook using the DSL.

Remarks

Creates a new Excel workbook using the DSL.

Examples

Create a workbook with a sheet and a few cells.


PS>New-OfficeExcel -Path .\report.xlsx { ExcelSheet 'Data' { ExcelCell -Address 'A1' -Value 'Region' } }
        

Creates report.xlsx and writes “Region” into cell A1 on the Data worksheet.

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

New-OfficeExcel [-AutoSave] [-Content <ScriptBlock>] -FilePath <String> [-NoSave] [-Open] [-PassThru] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

AutoSave SwitchParameter optionalposition: namedpipeline: False
Opt into OfficeIMO automatic saves during operations.
Content ScriptBlock optionalposition: 1pipeline: False
DSL scriptblock describing workbook content.
FilePath String requiredposition: 0pipeline: Falsealiases: Path
Destination path for the workbook.
NoSave SwitchParameter optionalposition: namedpipeline: False
Skip saving the workbook after running the DSL.
Open SwitchParameter optionalposition: namedpipeline: False
Open the workbook in Excel after saving.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit a FileInfo for convenience.

Outputs

System.Object