Further updates to on-line help

This commit is contained in:
jhoneill
2018-09-05 11:44:41 +01:00
parent 71c22d647d
commit 6393701a2f
6 changed files with 23 additions and 3 deletions

View File

@@ -1142,7 +1142,10 @@ function Add-WorkSheet {
function Select-Worksheet {
<#
.SYNOPSIS
Sets the selected tab in an Excel workbook to be a Particular sheet, and unselects all the others.
Sets the selected tab in an Excel workbook to be the chosen sheet, and unselects all the others.
.DESCRIPTION
Sometimes when a sheet is added we want it to be the active sheet, sometimes we want the active sheet to be left as it was.
Select-Worksheet exists to change the which sheet is the selected tab when Excel opens the file.
.EXAMPLE
Select-Worksheet -ExcelWorkbook $ExcelWorkbook -WorksheetName "NewSheet"
$ExcelWorkbook holds the a workbook object containing a sheet named "NewSheet";

View File

@@ -1,7 +1,12 @@
Function Open-ExcelPackage {
<#
.Synopsis
Returns an Excel Package Object with for the specified XLSX ile
Returns an Excel Package Object for the specified XLSX file
.Description
Import-Excel and Export-Excel open an Excel file, carry out their tasks and close it again.
Sometimes it is necessary to open a file and do other work on it. Open-Excel package allows the file to be opened for these tasks.
It takes a KillExcel switch to make sure Excel is not holding the file open; a password parameter for existing protected files,
and a create switch to set-up a new file if no file already exists.
.Example
$excel = Open-ExcelPackage -path $xlPath
$sheet1 = $excel.Workbook.Worksheets["sheet1"]
@@ -18,6 +23,7 @@
[Parameter(Mandatory=$true)]$Path,
#If specified, any running instances of Excel will be terminated before opening the file.
[switch]$KillExcel,
#The password for a protected worksheet, as a [normal] string (not a secure string.)
[String]$Password,
#By default open only opens an existing file; -Create instructs it to create a new file if required.
[switch]$Create

View File

@@ -54,7 +54,7 @@
$PivotColumns,
#Fields to use to filter in the Pivot table
$PivotFilter,
#By default Pivot tables have Totals for each Row (on the right) and for each column at the bottom. This allows just one or neither to be selected.
#If there are multiple datasets in a PivotTable, by default they are shown seperatate rows under the given row heading; this switch makes them seperate columns.
[Switch]$PivotDataToColumn,
#Define whther totals should be added to rows, columns neither, or both (the default is both)
[ValidateSet("Both","Columns","Rows","None")]
@@ -233,8 +233,10 @@ function New-PivotTableDefinition {
$PivotColumns,
#Fields to use to filter in the Pivot table
$PivotFilter,
#If there are multiple datasets in a PivotTable, by default they are shown seperatate rows under the given row heading; this switch makes them seperate columns.
[Switch]$PivotDataToColumn,
#By default Pivot tables have Totals for each Row (on the right) and for each column at the bottom. This allows just one or neither to be selected.
#Define whther totals should be added to rows, columns neither, or both (the default is both)
[ValidateSet("Both","Columns","Rows","None")]
[String]$PivotTotals = "Both",
#Included for compatibility - equivalent to -PivotTotals "None"

View File

@@ -23,6 +23,7 @@
When given a valid URI set-Column makes it a hyperlink The column will be autosized to fit the links.
#>
[cmdletbinding()]
[OutputType([OfficeOpenXml.ExcelColumn],[String])]
Param (
#If specifing the worksheet by name the ExcelPackage object which contains it needs to be passed
[Parameter(ParameterSetName="Package",Mandatory=$true)]

View File

@@ -17,6 +17,7 @@
The script block can use $row, $column, $ColumnName, $startRow/Column $endRow/Column
#>
[cmdletbinding()]
[OutputType([OfficeOpenXml.ExcelRow],[String])]
Param (
#An Excel package object - e.g. from Export-Excel -passthru - requires a sheet name
[Parameter(ParameterSetName="Package",Mandatory=$true)]

View File

@@ -2,6 +2,12 @@
<#
.SYNOPSIS
Applies Number, font, alignment and colour formatting to a range of Excel Cells
.DESCRIPTION
Set-Format was created to set the style elements for a range of cells, this includes autosizing and hiding, setting
font elements (Name, Size, Bold, Italic, Underline & UnderlineStyle and Subscript & SuperScript), font and background colors,
borders, text wrapping, rotation, aliginment within cells, and number format.
It has been extended to set Values, Formulas and set ArrayFormulas (sometimes called Ctrl-shift-Enter [CSE] formulas); because of this
it has an alias of Set-ExcelRange - in the future the Alias and Canonical name may swapped.
.EXAMPLE
$sheet.Column(3) | Set-Format -HorizontalAlignment Right -NumberFormat "#,###"
Selects column 3 from a sheet object (within a workbook object, which is a child of the ExcelPackage object) and passes it to Set-Format which formats as an integer with comma seperated groups
@@ -9,6 +15,7 @@
Set-Format -Address $sheet.Cells["E1:H1048576"] -HorizontalAlignment Right -NumberFormat "#,###"
Instead of piping the address in this version specifies a block of cells and applies similar formatting
#>
[cmdletbinding()]
Param (
#One or more row(s), Column(s) and/or block(s) of cells to format
[Parameter(ValueFromPipeline = $true,ParameterSetName="Address",Mandatory=$True,Position=0)]