That's because you used undef, not defined.
In reply to Re^4: How to get cell format of xls by moritz in thread How to get cell format of xls by bimleshsharma