Export-Excel :
* Fixed a typo in the message at line 373.
* Now catch an attempt to both clear the sheet and append to it.
* Fixed some issues when appending to sheets where the header isn't in
row 1 or the data doesn't start in column 1.
* Added support for more settings when creating a pivot chart.
* Corrected a typo PivotTableName was PivtoTableName in definition of
New-PivotTableDefinition
Add-ConditionalFormat and Set-Format added to the parameters so each has
the choice of working more like the other.
Added Set-Row and Set-Column - fill a formula down or across.
Added Send-SQLDataToExcel. Insert a rowset and then call Export-Excel
for ranges, charts, pivots etc
Param block in close was re-ordered leaving a parameter in the middle
missing a comma and the parameter at the end had a comma it should not
have done.
Export-Excel.ps1
1. No code seems to act on the "NoClobber" parameter, I had previously
added a "ClearSheet" parameter which removes the worksheet and any past
data (before if there were fewer rows or columns in the new data, the
old would not be over-written)
2. I have made the whole of the process{} block in export-Excel subject
to IF ($target data) .... this way things which are processed in the
end{} block can be done in a seperate call to Export-Excel without the
need to load data. Because of this there should be no need for the Open
and Close -ExcelPackage functions going forward, but I've left them in
place for now
3. Fixed a bug when setting the target range it was previously setting
the end of the range to be the number of columns which failed if the
data was inserted at a column other than one.
4. I've moved the top left corner of a pivot chart so it sits closer to
the data.
5. I've change the check for inserting a pivot table so if
-InsertPivotChart is specified it implies -insertPivotTable.
Formatting.
6. The previous check in was not up-to date and contained some issues
with conditional formatting which I had fixed in the past.
7. Fixed a peformance bug in set-format where a foreach intended to
allow the same format to be applied to multiple ranges would format a
large blocks of cells one-by-one if it was the only range passed. .
8. Improved online help for the formatting commands.
Export charts
9. My current project is importing a lot of data into Excel and needs to
take Excel charts out as JPG files. I've thrown in the Export-Charts
script as "something for the pot", even though the connection with the
rest of work is loose,
Changed Export-Excel.ps1
#1 @ Line 197 Made new parameter sets . Default, and table already
existed and use path. Added DefaultPackage and TablePackage
A New parameter "Package" allows an ExcelPackage object returned by
-passThru to be passed in
~Line 400 code to use package or path depending on path passed.
(also added Open-ExcelPackage to get the object without exporting and
Close-ExcelPackage to close it nicely - these are in their own file)
#2. @ Line 256 added new parameter excludeProperty to remove unwanted
properties without needing to go through select-object
~Line 459 added logic to exclude the properties specified in the new
parameter
#3 . @ Line 262 Added new parameter Append
~Line 420 code to read the existing headers and move the insertion point
below the current data
(normal behaviour is to check if headers exist when adding data in the
process block, which makes this change wonderfully easy)
~Line 510 changed basis for identifying named ranges and changed scope
for rangeName so it can be used on other sheets
#4. ~Line 550. Remove any existing Pivot table before trying to
[re]create it.
Added formatting.ps1 which applies conditional and normal formats -
requires an ExcelPackage to be open.
Added Open-ExcelPackage.ps1 (which contains a close function as well to
get the the object and save it ) open allows the sheet to be loaded
into a package object without needing to export .
Updated .psm1 to add the formating and open/close ps1 files.
Fix Bug, AutoFilter with TableName create corrupted Excel file.
https://github.com/dfinke/ImportExcel/issues/65
You now cannot set AutoFilter and TableName at the same time.
"-Now" will not auto add AutoFilter if TableName set.