Thread ole32 -> Excel-chart bild einfügen (6 answers)
Opened by NixIsFix at 2009-05-11 16:55

NixIsFix
 2009-05-18 10:34
#121651 #121651
User since
2009-04-28
16 Artikel
BenutzerIn
[default_avatar]
so nochmal der ganze code des "mini" files

(code von "Gast")
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
use strict;
use Getopt::Long;
use File::Basename;
use Spreadsheet::WriteExcel;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3;    # die on errors...


my $excel = Win32::OLE->GetActiveObject('Excel.Application')|| Win32::OLE->new( 'Excel.Application', 'Quit' );

my $workbook = $excel -> Workbooks -> Add();

my $sheet = $workbook -> Worksheets( 1 ); 
my $range = $sheet -> Range( 'A1:G2' );
$range -> {Value} = [ [ qw( 14 24 4 35 26 45 34 ) ], [ qw( 34 25 23 24 34 32 11 ) ] ];

my $chart = $workbook -> Charts -> Add();
$chart -> SetSourceData( { Source => $range, PlotBy => xlRows } );
$chart -> Activate;
my $range2 = $chart -> Pictures -> Insert( 'Testbild.jpg' );
$range2 -> ShapeRange -> IncrementLeft( 60 );
$range2 -> ShapeRange -> IncrementTop( 60 );


und es bleibt immer noch dieselbe fehlermeldung
->
Code: (dl )
1
2
3
4
5
6
OLE exception from "Microsoft Office Excel":

Die Insert-Eigenschaft des Pictures-Objektes kann nicht zugeordnet werden.

Win32::OLE(0.1709) error 0x800a03ec
in METHOD/PROPERTYGET "Insert" at D:\Testbereich\DiagrammTest2.pl line 21


nun ne idee?

View full thread ole32 -> Excel-chart bild einfügen