mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Better handling of Empry values when setting Columns/Rows
This commit is contained in:
@@ -147,7 +147,8 @@
|
||||
if ($Value -is [scriptblock] ) {
|
||||
#re-create the script block otherwise variables from this function are out of scope.
|
||||
$cellData = & ([scriptblock]::create( $Value ))
|
||||
Write-Verbose -Message $cellData
|
||||
if ($null -eq $cellData) {Write-Verbose -Message "Script block evaluates to null."}
|
||||
else {Write-Verbose -Message "Script block evaluates to '$cellData'"}
|
||||
}
|
||||
else{$cellData = $Value}
|
||||
if ($cellData -match "^=") { $Worksheet.Cells[$Row, $column].Formula = ($cellData -replace '^=','') } #EPPlus likes formulas with no = sign; Excel doesn't care
|
||||
|
||||
Reference in New Issue
Block a user