Use Win32::OLE to control Excel and print from within Excel.
I used the code below several years ago to print out an Excel sheet every day. Please note - this code is a snippet and is untested as is.
Hopefully, you can get the idea and adapt to your situation.
use strict; use warnings; use Win32::OLE qw(in with); use Win32::OLE::Variant; use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; my $excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', + 'Quit'); my $book = $excel->Workbooks->Open("I:\\Path\\To\\File\\file +.xls"); my $sheet = $excel->Worksheets(1); #Sub PrintOut([From], [To], [Copies], [Preview], [ActivePrinter], [Pri +ntToFile], [Collate]) $sheet->PrintOut(1,1,1,0,"HP LaserJet IIIP",0,0); $book->Save; $book->Close; print "Done\n";
In reply to Re: need program to hang out awhile?
by tokpela
in thread need program to hang out awhile?
by cypress
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |