Commit Graph

118 Commits

Author SHA1 Message Date
jhoneill
dbd35721ee Fix broken test & regression re: passwords 2019-07-24 12:02:22 +01:00
jhoneill
7c2bbf9595 Read-only imports + small test fix 2019-06-11 15:09:36 +01:00
jhoneill
b488ffc700 Allow import Excel to take packages not just paths 2019-05-24 16:23:13 +01:00
jhoneill
b06e9e35b7 Fixed file case errors impacting loading on Linux 2019-05-01 10:16:13 -07:00
jhoneill
6c7f00b031 Linted with the updated PSScriptAnalyzer. 2019-04-30 13:28:52 -07:00
dfinke
d3d8d76a71 fixed psm1. added .ps1 to Set-WorkSheetProtection 2019-03-02 14:03:26 -05:00
jhoneill
22283604f8 Sync with DFinke's master 2019-02-25 18:14:46 +00:00
jhoneill
89a8cb0469 Added data validation 2019-01-21 14:20:57 +00:00
dfinke
9db2bc068e Added to psm1 2018-12-30 08:29:18 -05:00
dfinke
e1fe36699b Added Export-StocksToExcel 2018-11-25 16:16:16 -05:00
Doug Finke
c07fc81dfe Merge pull request #458 from jhoneill/master
Fixed #457 & a couple more tweaks
2018-10-08 17:05:41 -04:00
Doug Finke
6683bed799 Merge pull request #455 from SQLvariant/master
Added Example for SQL Server
2018-10-08 14:47:27 -04:00
dbaileyut
50905c7989 * Fix typo in Import-Excel help description 2018-10-05 16:04:19 -05:00
jhoneill
91a7c17341 perf: removed verbose from loop in import. tests: better alias check 2018-10-04 21:31:47 +01:00
Aaron Nelson
3c18af50b9 Added Example for SQL Server to Import-Excel
Added an example for INSERTing rows into a SQL Server table from the Import-Excel function.
2018-10-04 15:36:42 -04:00
jhoneill
cea9713129 Relocation of and parameter improvments to Chart, & Pivot table; 2018-08-23 12:12:56 +01:00
jhoneill
5a235e309e Tider errors for file open on import; password tests 2018-08-07 15:00:33 +01:00
jhoneill
77fb51da8d Argument completers for worksheet name & number format. Fixed bug with -hidden 2018-07-31 15:07:33 +01:00
dfinke
f785fe0566 Merge latest changes 2018-07-15 12:11:58 -04:00
dfinke
91eabeada1 resolved merge conflicts 2018-06-30 20:46:54 -04:00
jhoneill
a3693a7faf Many changes. Detailed on Readme.md under what's new 2018-06-25 14:06:43 +01:00
jhoneill
f689c84d04 needed to sync
a
2018-06-22 21:36:46 +01:00
jhoneill
d74cce91b6 Added join Worksheet
Moved "MoveTo…" functionality into Add-Worksheet and gave it copy worksheet functionality
Added create new file functionality to Open-ExcelPackage  - requires a -create switch so previous "Open for read if it exists" behaviour is kept. 
Fixed Conditional formatting so background pattern is "None" not "Solid" by default. 
Tidied comments and help in Merge and Compare 
Added Join Worksheet
Added Extra parameters, sanity check and help to New-PivotTableDefinition
2018-06-17 03:15:47 +01:00
dfinke
3ce9018d3c updated 2018-06-08 16:55:08 -04:00
jhoneill
e47e1d99c1 Added EndRow, StartColumn, EndColumn to Import-Excel
Start row already existed. 
Aliases allow you to specify -no header -top 10 -bottom 20 -left 6 -right 8 
Start row can be below end right row, and start (left) column can be to the right of the end column - this allows read in reverse order, but does generate a warning.
2018-06-08 10:43:57 +01:00
jhoneill
39a68e71c4 Tidying of case, parameter clarity, removal of aliasess.
Added timeout to send-SqlDataToExcel
Added Merge WorkSheet
Fixed bugs in Compare-Worksheet
2018-05-26 22:24:36 +01:00
jhoneill
da7a70752c Added Compare worksheet
Added Compate-worksheet function (in its own PS1) Updated
ColorCompletion.ps1 to hold argument completers for set row, and set
column, and removed  duplicates from formatting.ps1
Fixed case of Path param in Open-ExcelPackage
Added comments about date format (m/d/yy is trapped and translated to
local date)
2018-04-26 16:19:59 +01:00
Ili Metuky
33d86cb3c9 Fixed the bug "Unable to find type [PSPlot]"
Also added a test for it in ImportExcel.Tests.ps1

The previous fix was broke again by commit:
bd40cfe829 (diff-f50d26003c0baf98f417a44fc1cac92b)
2018-04-16 20:19:10 +03:00
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