use constant xlDialogPrint => 8; sub print { my $self = shift; my $dlg = $self->{Excel}->Dialogs(xlDialogPrint); my $response = $dlg->Show; }