Commit Graph

140 Commits

Author SHA1 Message Date
dfinke
2f70cd88e8 Allow xlsm files to be read 2018-01-09 19:39:13 -05:00
dfinke
e8a3d3f350 Added -Force to New-Alias 2018-01-02 11:32:04 -05:00
dfinke
9b57853881 fixed 2017-11-29 18:19:51 -05:00
jhoneill
9969a94309 Minor Fixes, Set-Row, Set-Column, Send-SQLDataToExcel
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
2017-11-15 18:04:14 +00:00
dfinke
624a4e4b82 Updated list of ps1 files for copying and importing 2017-10-30 18:39:04 -04:00
jhoneill
890906ff10 Fixes to formatting , new Export charts tool (requires Excel.exe) help updates and Export excel support for "No data" use
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,
2017-10-24 09:02:14 +01:00
jhoneill
bd40cfe829 Append, and formatting
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.
2017-10-21 18:14:02 +01:00
ili101
8ad38b544e Fix Bug, Unable to find type [PSPlot] in ISE
When loading cmdlet info from ISE "Commands" panel you get the error
"Unable to find type [PSPlot]"
https://github.com/dfinke/ImportExcel/issues/131
2017-10-05 00:15:57 +03:00
DarkLite1
efb9e158b5 Added help text 2017-09-28 14:21:55 +02:00
DarkLite1
12fd17b9ea Bumped version to 4.0.1
- Renamed 'TopRow' to 'StartRow' and added alias
  (More concise with future parameter names like 'StartColumn')
- Removed 'ChangeList' in 'Notes' as this is tracked in Git
- Added parameter 'Password' to import password protected files
- Added Pester tests for parameter aliasses and:
	- parameter 'Password'
	- parameter 'Path' validation for extensions '.xls' and '.xlsx'
	- 'HeaderName' witb blanks
- Changed comments in Pester tests from '<# Comment #>' to '# Comment'
  (Easier to outcomment a whole block of tests when performing a test on a specific piece of code)
2017-09-28 14:12:07 +02:00
DarkLite1
295b369a81 Improved paramter validation and fixed 'WorksheetName' position. Extra Pester tests added too. 2017-09-20 09:35:57 +02:00
DarkLite1
a0563d4daa Import-Excel updated help 2017-09-19 16:00:11 +02:00
DarkLite1
2c16cdcbfe Import-Excel select first worksheet by default 2017-09-19 15:55:13 +02:00
DarkLite1
d75350c659 Improved tests for emtpy rows after TopRow x 2017-09-11 14:06:45 +02:00
DarkLite1
323c52a24b Added alias HeaderRow for TopRow to ImportExcel 2017-09-08 12:53:23 +02:00
DarkLite1
e42fa83043 Added position to params of 'Import-Excel' 2017-08-22 08:48:20 +02:00
DarkLite1
662d5913ae Rewrote 'Import-Excel':
- Added parameter sets for proper parameter validation and to make sure '-NoHeader' and '-HeaderRow' aren't used together
- Added try/catch clause, CmdLetBinding and verbose messages
- Renamed 'HeaderRow' to 'TopRow' to avoid confusion with other parameters
- Renamed '-Header' to '-HeaderName'
- Added test for duplicate property names
- Added test for empty worksheet
- Added test for no data after TopRow
- Fixed incorrect import when there's no value in the first column
- Fixed values being imported under the wrong property name in case one
- Fixed incorrect import in case column A is empty and B and C not ( '$Worksheet.Dimension.Columns' is unreliable because it will say 2 columns are in use while it should say 3).
(Ex. Add data in cell B2 and C2, use the '-NoHeader' switch, notice P1 and P2 are incorrectly blanc.)
2017-08-21 15:34:30 +02:00
DarkLite1
d8d624ba9c Added the function 'Update-FirstObjectProperties'
Added help text in 'Export-Excel'
Added try/catch to 'Install' and 'InstallModule'
Improved code readability in 'Install' and 'InstallModule'
2017-07-26 13:37:08 +02:00
dfinke
b90087bd63 Updated to include ConvertTo-ExcelXlsx 2017-07-03 13:44:01 -04:00
dfinke
615f677b2e Added convert from Excel 2017-06-15 19:34:04 -04:00
dfinke
26f6df7168 Added Export-ExcelAsSQLInsert 2017-06-14 22:44:11 -04:00
DarkLite1
cd8a57605f Fix for Excel-Export #168
- Changed 'InvariantInfo' to 'CurrentInfo', to respect the systems
regioinal settings
- Added verbose text to see what's happening
2017-02-21 14:59:56 +01:00
DarkLite1
e68a5f27e5 Fixed 'DataOnly' header issue
This has been fixed: Looks like it adds the "headers" in the sheet to
the data when you specify -DataOnly
2017-02-14 09:38:08 +01:00
DarkLite1
7cdf40e0c8 Added 'Get-ExcelWorkbookInfo' 2017-02-14 09:13:46 +01:00
DarkLite1
9790cb958c Revert "Revert "Added 'DataOnly' parameter""
This reverts commit 782c027960.
2017-02-08 09:51:13 +01:00
DarkLite1
782c027960 Revert "Added 'DataOnly' parameter"
This reverts commit 1ee1396a56.
2017-02-08 09:50:39 +01:00
DarkLite1
1ee1396a56 Added 'DataOnly' parameter
Added 'DataOnly' parameter: When used we will only generate objects for
rows that contain text values, not for empty rows or columns.
2017-02-08 09:48:16 +01:00
DarkLite1
b93c8749d9 Added help
Added help text for 'Import-Excel'
2017-02-08 09:44:44 +01:00
dfinke
29e44e0aa1 Add scriptblock for Cell Fill Style 2016-12-22 11:24:18 -05:00
Xelsirko
710987d738 Fixes #129. 2016-09-28 11:18:32 +00:00
dfinke
3db1473c05 Fixed #115 2016-08-12 17:16:15 -04:00
dfinke
372fdc4213 Fixes #68 Import-Excel headers no data 2016-07-21 19:54:36 -04:00
dfinke
1d897286b7 Resolve the path with ProviderPath for UNC 2016-07-01 15:55:15 -04:00
dfinke
7b4178070a Updated for new ps1 2016-06-01 17:19:57 -04:00
dfinke
045234dd81 Only load PS Class for -gt V5. Thanks https://github.com/W1M0R 2016-04-30 15:23:13 -04:00
Brian Addicks
3c5381182f Added ValidateScript block to Path parameter for Import-Excel 2016-03-30 08:07:40 -04:00
dfinke
42d0ad0378 Add Plot function 2016-03-20 22:51:07 -04:00
dfinke
b777c06838 Added Get-Range, New-Plot and Plot Cos example 2016-03-18 09:36:18 -04:00
dfinke
ac71736725 Added Import-Html support and examples 2016-02-22 11:27:56 -05:00
dfinke
acb02d222e Implemented conditional text formatting 2016-01-17 14:56:25 -05:00
dfinke
25a970e743 Added Get-ExcelSheetInfo 2016-01-07 11:42:38 -05:00
dfinke
5908f33341 Initial commit 2015-12-19 11:39:19 -05:00
dfinke
652255ca9d Initial commit [charting] 2015-12-18 12:58:42 -05:00
dfinke
4c620ee630 Added several new features 2015-12-17 16:53:13 -05:00
dfinke
dc753b67b2 Set [Parameters] explicitly 2015-12-06 17:07:40 -05:00
dfinke
59d0c4fca7 Renamed Sheet1 parameter, added alias 2015-11-12 17:25:43 -05:00
dfinke
a256b69b24 Added HeaderRow #47 2015-10-19 18:42:12 -04:00
dfinke
cd46819c79 Added -NoHeader and returns .Value 2015-10-15 11:53:47 -04:00
dfinke
4b59eb0e75 Merged ValidateSet for Encoding and Extension 2015-10-01 11:11:05 -04:00
Irwin Strachan
3eac21c11a Update ImportExcel.psm1
Created a ValidateSet for Encoding and Extension. removed Extension from the params. Removed Encoding at the Export-Csv as it is already included in params
2015-10-01 11:11:04 -04:00