Thread Excel 2. Arbeitsblatt ausdrucken (3 answers)
Opened by Iquana at 2009-09-17 17:56

havi
 2009-09-18 11:45
#125937 #125937
User since
2003-08-04
2036 Artikel
BenutzerIn
[Homepage]
user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

use warnings;
use strict;
use Win32::OLE;

sub PrintExcelSheet($);

PrintExcelSheet("C:\\Lokale_Daten\\Mappe1.xls");

sub PrintExcelSheet($) {

   my $dateiXls = shift;

   use Win32::OLE        qw(in with);
   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("$dateiXls");
   $book->Worksheets(2)->PrintOut;

   $excel->Quit();

} # PrintExcelSheet

Last edited: 2009-09-18 11:47:07 +0200 (CEST)

View full thread Excel 2. Arbeitsblatt ausdrucken