external help file | Module Name | online version | schema |
---|---|---|---|
ImportExcel-help.xml |
ImportExcel |
2.0.0 |
Closes an Excel Package, saving, saving under a new name or abandoning changes and opening the file in Excel as required.
Close-ExcelPackage [-ExcelPackage] <ExcelPackage> [-Show] [-NoSave] [[-SaveAs] <Object>] [[-Password] <String>] [-Calculate] [<CommonParameters>]
When working with an ExcelPackage object, the Workbook is held in memory and not saved until the .Save() method of the package is called.
Close-ExcelPackage saves and disposes of the Package object.
It can be called with -NoSave to abandon the file without saving, with a new "SaveAs" filename, and/or with a password to protect the file. And -Show will open the file in Excel; -Calculate will try to update the workbook, although not everything can be recalculated
Close-ExcelPackage -show $excel
$excel holds a package object, this saves the workbook and loads it into Excel.
Close-ExcelPackage -NoSave $excel
$excel holds a package object, this disposes of it without writing it to disk.
Package to close.
Type: ExcelPackage
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Open the file in Excel.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Abandon the file without saving.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Save file with a new name (ignored if -NoSave Specified).
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Password to protect the file.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Attempt to recalculation the workbook before saving
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.