sub SetErrorState { my($self) = shift; my($Sheet) = $self->{SHEET}; my($row, $col, $err) = @_; my $range = sprintf("%c%d", ord('A') + $col, $row); my $cell = $Sheet->Range($range); if($err) { $cell->ClearComments(); $cell->AddComment($err); $cell->Comment->{Visible} = 0; $cell->Interior->{ColorIndex} = 6; } else { $cell->Interior->{ColorIndex} = xlNone; $cell->ClearComments(); } }