I want to hide 2 cells (Which contain say discount and discount %) from printing ( not make them invisible) when discount percentage is 0 using a macro is 0. Here is the code I have used:
rem before this is some other code
If DiscPercent.getValue = 0 Then
Disc.CellProtection.isPrintHidden = True
DiscPercent.CellProtection.isPrintHidden = True
Print DiscPercent.CellProtection.isPrintHidden
Else
Disc.CellProtection.isPrintHidden = False
DiscPercent.CellProtection.isPrintHidden = False
End If
The trouble is that the isPrintHidden property is not getting set and I don’t know why. I am only able to change this property from the calc UI and I wrote a dummy macro to verify this. Is this property a read only property?? Am I missing something??
Thanks