my $rpt = GTIMs::Report->new('Schedule::Daily', $args); $rpt->create; # populate the workbook with data $rpt->print; # print the workbook $rpt->destroy; # destroy the workbook ######################## # the report print function simply looks like this sub print { my ($self, $copies) = @_; $copies = 1 unless $copies; $self->{WorkBook}->PrintOut(Copies => 1); } #### with ($Sheet->PageSetup, LeftHeader => '', CenterHeader => '&"Arial,Bold"&16' . $self->{Schedule}{$schedule}{Title} . chr(10) . "&12 $day $self->{Period}{Start}" . chr(10) . "$start - $end", RightHeader => '', LeftFooter => 'Printed &D &T', CenterFooter => '', RightFooter => 'Page &P of &N', LeftMargin => $Sheet->Application->InchesToPoints(0.15), RightMargin => $Sheet->Application->InchesToPoints(0.15), TopMargin => $Sheet->Application->InchesToPoints(1.0), BottomMargin => $Sheet->Application->InchesToPoints(0.5), HeaderMargin => $Sheet->Application->InchesToPoints(0.25), FooterMargin => $Sheet->Application->InchesToPoints(0.25), PrintHeadings => 0, PrintGridlines => 0, PrintComments => xlPrintNoComments, PrintQuality => 600, CenterHorizontally => 1, CenterVertically => 0, Orientation => xlPortrait, Draft => 0, PaperSize => xlPaperLetter, FirstPageNumber => xlAutomatic, Order => xlDownThenOver, BlackAndWhite => 0, Zoom => Variant(VT_BOOL, 0), FitToPagesWide => 1, FitToPagesTall => 1, PrintErrors => xlPrintErrorsDisplayed, PrintTitleRows => '$1:$2', PrintTitleColumns => '$A:$D', ); #### use constant xlDialogPrint => 8; sub print { my $self = shift; my $dlg = $self->{Excel}->Dialogs(xlDialogPrint); my $response = $dlg->Show; }