Excell empty cell

Any idea why below doesnt work???

$virtualNetwork = $csdWorkBook.worksheets.item("Virtual Network")

$test=$virtualNetwork.cells.item(4,7)  #check if this cell is empty

if ($test -eq "") {
write-host "Blank"
} else {
write-host "Not blank"

}

May 11th, 2014 11:43pm

how about like this:

$virtualNetwork = $csdWorkBook.worksheets.item("Virtual Network")
$test=$virtualNetwork.cells.item(4,7)  #check if this cell is empty
if ([string]::IsNullOrEmpty($test))) {
write-host "Blank"
} else {
write-host "Not blank"
}

Free Windows Admin Tool Kit Click here and download it now
May 12th, 2014 1:52am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics