Hello Jagdish,
I have not gotten that far into Excel with perl yet, but Ken Baker sent me
this url which looks pretty inclusive to me.

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.16/lib/Spreadshee
t/WriteExcel.pm#set_header(%24string%2C_%24margin

HTH,
Eric

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
jagdish eashwar
Sent: Sunday, May 14, 2006 9:04 AM
To: PerlWin32
Subject: OLE - GETTING EXCEL CELL NAMES

Hi,

I am unable to get the name of the cells in my excel worksheet though I can
get those of my workbook and my worksheet. I have named my workbook as
'myworkbook', my worksheet as 'myworksheet, and cell A1 as 'mycell'.I am
using the following code:

use warnings;
use strict;

use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
use Win32::OLE::Variant;
use Win32::OLE::NLS qw(:LOCALE :DATE);

$Win32::OLE::Warn = 3; # Die on Errors.

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

$Excel->{DisplayAlerts}=0;

my $Book = $Excel->Workbooks->Add();
my $Sheet = $Book->Worksheets(1);
       $Sheet->Activate();
       $Sheet->{'Name'} = "myworksheet";

my $cell = $Sheet->Cells(1,1);
        $cell->{'Name'} = 'mycell';
        $Book->SaveAs('myworkbook'); 
print "My workbook name is $Book->{Name}\n";
print "My worksheet name is $Sheet->{Name}\n";
print "My cell name is $cell->{Name}\n";
        $Book->Save;

#End of script

The output I am getting is :

My workbook name is myworkbook.xls
My worksheet name is myworksheet
My cell name is Win32::OLE=HASH(0x1ce747c)

Why am I unable to get the cell name?

Thanks,

Jagdish Eashwar


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to