Better handling of autosize (again)

This commit is contained in:
jhoneill
2019-11-01 01:57:04 +00:00
parent 4d17a09537
commit 6b626e8f5f
5 changed files with 9 additions and 13 deletions

View File

@@ -229,7 +229,7 @@
}
else {Write-Warning -Message ("Can set the height of a row or a range but not a {0} object" -f ($Range.GetType().name)) }
}
if ($Autosize -and ([environment]::OSVersion.Platform -like "win*" -or $env:AUTOSIZE)) {
if ($Autosize -and -not $env:NoAutoSize) {
try {
if ($Range -is [OfficeOpenXml.ExcelColumn]) {$Range.AutoFit() }
elseif ($Range -is [OfficeOpenXml.ExcelRange] ) {