Bumped version. Added url for how to videos

This commit is contained in:
dfinke
2017-11-24 10:16:13 -05:00
parent 1df63e3206
commit 0f9bf07d30
2 changed files with 37 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
RootModule = 'ImportExcel.psm1'
# Version number of this module.
ModuleVersion = '4.0.5'
ModuleVersion = '4.0.6'
# ID used to uniquely identify this module
GUID = '60dd4136-feff-401a-ba27-a84458c57ede'
@@ -19,7 +19,7 @@ CompanyName = 'Doug Finke'
Copyright = 'c 2015 All rights reserved.'
# Description of the functionality provided by this module
Description = 'PowerShell module to import/export Excel spreadsheets, without Excel'
Description = 'PowerShell module to import/export Excel spreadsheets, without Excel. Check out the How To Videos https://www.youtube.com/watch?v=U3Ne_yX4tYo&list=PL5uoqS92stXioZw-u-ze_NtvSo0k0K0kq'
# Minimum version of the Windows PowerShell engine required by this module
# PowerShellVersion = ''

35
RemoveWorksheet.ps1 Normal file
View File

@@ -0,0 +1,35 @@
Function Remove-WorkSheet {
Param (
$Path,
$WorksheetName
)
$Path = (Resolve-Path $Path).ProviderPath
$Excel = New-Object -TypeName OfficeOpenXml.ExcelPackage $Path
$workSheet = $Excel.Workbook.Worksheets[$WorkSheetName]
if($workSheet) {
if($Excel.Workbook.Worksheets.Count -gt 1) {
$Excel.Workbook.Worksheets.Delete($workSheet)
} else {
throw "Cannot delete $WorksheetName. A workbook must contain at least one visible worksheet"
}
} else {
throw "$WorksheetName not found"
}
$Excel.Save()
$Excel.Dispose()
}
cls
ipmo .\ImportExcel.psd1 -Force
$names = Get-ExcelSheetInfo C:\Temp\testDelete.xlsx
$names | % { Remove-WorkSheet C:\Temp\testDelete.xlsx $_.Name}
##Remove-WorkSheet C:\Temp\testDelete.xlsx sheet6