Leser: 20
ActiveChart.Pictures.Insert("bild.bmp").Select
$chart->Pictures->Insert("bild.bmp");
1
2
3
4
5
6
LE 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:\TestScript.pl line 113
1 2 3 4 5 6 7 8 9 10 11 12
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 );
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:\TestScript.pl line 113
1 2 3
my $range = $chart -> Pictures -> Insert( 'bild.bmp' ); $range -> ShapeRange -> IncrementLeft( 60 ); $range -> ShapeRange -> IncrementTop( 60 );
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 );
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