mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Compare commits
9 Commits
566a092736
...
71f3af990a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
71f3af990a | ||
|
|
71ef167868 | ||
|
|
fa907da4a4 | ||
|
|
24c205e65d | ||
|
|
a1418a336e | ||
|
|
63683db543 | ||
|
|
36b5495bd5 | ||
|
|
722516de7c | ||
|
|
57bb049111 |
@@ -6,7 +6,7 @@
|
||||
RootModule = 'ImportExcel.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '7.8.7'
|
||||
ModuleVersion = '7.8.9'
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
|
||||
|
||||
@@ -45,11 +45,18 @@ function ConvertTo-ExcelXlsx {
|
||||
throw "Could not create Excel.Application ComObject. Please verify that Excel is installed."
|
||||
}
|
||||
|
||||
$Excel.Visible = $false
|
||||
$null = $Excel.Workbooks.Open($xlsFile.FullName)
|
||||
$Excel.ActiveWorkbook.SaveAs($xlsxPath, $xlFixedFormat)
|
||||
$Excel.ActiveWorkbook.Close()
|
||||
$Excel.Quit()
|
||||
try {
|
||||
$Excel.Visible = $false
|
||||
$null = $Excel.Workbooks.Open($xlsFile.FullName, $null, $true)
|
||||
$Excel.ActiveWorkbook.SaveAs($xlsxPath, $xlFixedFormat)
|
||||
}
|
||||
finally {
|
||||
if ($null -ne $Excel.ActiveWorkbook) {
|
||||
$Excel.ActiveWorkbook.Close()
|
||||
}
|
||||
|
||||
$Excel.Quit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function Import-Excel {
|
||||
function Import-Excel {
|
||||
[CmdLetBinding()]
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "")]
|
||||
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSPossibleIncorrectUsageOfAssignmentOperator', '', Justification = 'Intentional')]
|
||||
@@ -161,7 +161,10 @@
|
||||
#using Hash tables: "we've seen it" is all we need, no need to worry about "seen it before" / "Seen it many times".
|
||||
$colHash = @{ }
|
||||
$rowHash = @{ }
|
||||
foreach ($cell in $sheet.Cells[$range]) {
|
||||
|
||||
$cells = $sheet.Cells[$range]
|
||||
|
||||
foreach ($cell in $cells) {
|
||||
if ($null -ne $cell.Value ) { $colHash[$cell.Start.Column] = 1; $rowHash[$cell.Start.row] = 1 }
|
||||
}
|
||||
$rows = ( $StartRow..$EndRow ).Where( { $rowHash[$_] })
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
# 7.8.9
|
||||
|
||||
- Thanks to (Edward Miller)[https://github.com/edwardmiller-mesirow] for improving `ConvertTo-ExcelXlsx`and making it more robust
|
||||
|
||||
# 7.8.8
|
||||
|
||||
- Fix the release
|
||||
|
||||
# 7.8.7
|
||||
|
||||
- Thanks to [Phil Bossman](https://github.com/pbossman) for the PR and fixing this.
|
||||
|
||||
Reference in New Issue
Block a user