API Reference
Cmdlet
New-OfficeExcel
Creates a new Excel workbook using the DSL.
Remarks
Runs the provided script block inside an ExcelSheet/ExcelCell DSL context and saves the file.
Examples
Example 1: 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 [-ApplicationName <String>] [-Author <String>] [-AutoSave] [-Category <String>] [-ClearCachedFormulaResults] [-Company <String>] [-Content <ScriptBlock>] [-DateSystem <1900|1904|NineteenHundred|NineteenFour>] [-Description <String>] [-DisableFastPackageWriter] [-DocumentTitle <String>] [-EvaluateFormulas] -FilePath <String> [-ForceFullCalculationOnOpen] [-Keywords <String>] [-LastModifiedBy <String>] [-Manager <String>] [-MarkFormulasDirty] [-NoSave] [-Open] [-PassThru] [-Password <String>] [-PdfPath <String>] [-SafePreflight] [-SafeRepairDefinedNames] [-Subject <String>] [-TemplatePath <String>] [-ValidateOpenXml] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- ApplicationName String
- Workbook application-name metadata.
- Author String
- Workbook author metadata.
- AutoSave SwitchParameter
- Opt into OfficeIMO automatic saves during operations.
- Category String
- Workbook category metadata.
- ClearCachedFormulaResults SwitchParameter
- Remove cached formula results before saving.
- Company String
- Workbook company metadata.
- Content ScriptBlock
- DSL scriptblock describing workbook content.
- DateSystem String
- Workbook date system for Excel date serials.
- Possible values:
1900,1904,NineteenHundred,NineteenFour - Description String
- Workbook description metadata.
- DisableFastPackageWriter SwitchParameter
- Disable OfficeIMO fast package writers for this save.
- DocumentTitle String
- Workbook document title metadata.
- EvaluateFormulas SwitchParameter
- Evaluate supported formulas and write cached values before saving.
- FilePath String
- Destination path for the workbook.
- ForceFullCalculationOnOpen SwitchParameter
- Request a full workbook recalculation when opened in Excel-compatible applications.
- Keywords String
- Workbook keyword metadata.
- LastModifiedBy String
- Workbook last-modified-by metadata.
- Manager String
- Workbook manager metadata.
- MarkFormulasDirty SwitchParameter
- Mark formula cells dirty before saving.
- NoSave SwitchParameter
- Skip saving the workbook after running the DSL.
- Open SwitchParameter
- Open the workbook in Excel after saving.
- PassThru SwitchParameter
- Emit a FileInfo for convenience.
- Password String
- Password used to save the workbook as an encrypted package.
- PdfPath String
- Optional PDF path to create from the same workbook before closing it.
- SafePreflight SwitchParameter
- Run OfficeIMO worksheet preflight cleanup before saving.
- SafeRepairDefinedNames SwitchParameter
- Repair common defined-name issues before saving.
- Subject String
- Workbook subject metadata.
- TemplatePath String
- Optional workbook template package copied before running the DSL.
- ValidateOpenXml SwitchParameter
- Validate the saved package with OpenXmlValidator and throw on errors.