我正在尝试在已经存在的 excel 文件中写入数据,但我尝试的代码是创建一个新工作表并用数据擦除旧工作表。这是我使用的代码
#!/usr/bin/perl –w
use strict;
use Spreadsheet::WriteExcel;
# Create a new Excel file
my $FileName = 'Report.xls';
my $workbook = Spreadsheet::WriteExcel->new($FileName);
# Add a worksheet
my $worksheet1 = $workbook->add_worksheet(); #<- My Doubt
# Change width for only first column
$worksheet1->set_column(0,0,20);
# Write a formatted and unformatted string, row and column
# notation.
$worksheet1->write(0,0, "Hello");
$worksheet1->write(1,0,"HI");
$worksheet1->write(2,0,"1");
$worksheet1->write(3,0,"2"); `
如何将当前工作表分配给$worksheet1
. 还有一件事是我需要读取已经存在的特定单元格。请给我一些指导。谢谢