R
robert.paschedag
Hi,
I'm trying to import some data into Excel with Perl. My Problem is,
that I cannot create an object of a type "QueryTable"
use strict;
use Win32::OLE 'with';
use Win32::OLE::Variant;
my ($app, $obj, $book, $sheet, $file, $table);
my $conn = 'TEXT;C:\\temp\\uni_source_target_language.csv';
my $variant_conn = Variant(VT_BSTR, $conn);
$app = Win32::OLE->new('Excel.Application', \&OLE_Quit) or die
"oops\n";
$book = $app->Workbooks->Add;
$sheet = $book->ActiveSheet;
$app->{Visible} = 1;
$table = $sheet->QueryTables->Add(Connection => $variant_conn,
Destination => $sheet->Range("A1"));
exit(0);
Subroutine .....
The $table is always "undef". What am I doing wrong?
pasche
I'm trying to import some data into Excel with Perl. My Problem is,
that I cannot create an object of a type "QueryTable"
use strict;
use Win32::OLE 'with';
use Win32::OLE::Variant;
my ($app, $obj, $book, $sheet, $file, $table);
my $conn = 'TEXT;C:\\temp\\uni_source_target_language.csv';
my $variant_conn = Variant(VT_BSTR, $conn);
$app = Win32::OLE->new('Excel.Application', \&OLE_Quit) or die
"oops\n";
$book = $app->Workbooks->Add;
$sheet = $book->ActiveSheet;
$app->{Visible} = 1;
$table = $sheet->QueryTables->Add(Connection => $variant_conn,
Destination => $sheet->Range("A1"));
exit(0);
Subroutine .....
The $table is always "undef". What am I doing wrong?
pasche