Excel이 설치되어있는 경우 Win32::OLE
을 사용하면 거의 문제가 없습니다. - 엑셀 및 워드 자동화에 이르기까지 모든
use Win32::OLE;
# use existing instance if Excel is already running
eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')};
die "Excel not installed" if [email protected];
unless (defined $ex) {
$ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;})
or die "Oops, cannot start Excel";
}
# get a new workbook
$book = $ex->Workbooks->Add;
# write to a particular cell
$sheet = $book->Worksheets(1);
$sheet->Cells(1,1)->{Value} = "foo";
# write a 2 rows by 3 columns range
$sheet->Range("A8:C9")->{Value} = [[ undef, 'Xyzzy', 'Plugh' ],
[ 42, 'Perl', 3.1415 ]];
# print "XyzzyPerl"
$array = $sheet->Range("A8:C9")->{Value};
for (@$array) {
for (@$_) {
print defined($_) ? "$_|" : "<undef>|";
}
print "\n";
}
# save and exit
$book->SaveAs('test.xls');
undef $book;
undef $ex;
기본적으로, Win32::OLE
당신에게 일의 거대한 다양성을 포함하는 VBA 또는 Visual Basic 응용 프로그램, 사용할 수 있습니다 모든 것을 제공 : 여기 Win32::OLE
의 자체 문서의 예입니다 Windows Script Host를 통해 네트워크 드라이브를 열거하고 탑재하는 방법에 대해 설명합니다. 그것은 ActivePerl의 지난 몇 판과 표준이되었습니다.
ParseExcel을 사용하여 Excel 서적에 쓸 방법이 보이지 않습니다. – user105033
Spreadsheet :: ParseExcel :: SaveParser가이를 수행합니다. 당신이 내 편집을 이겼어. :) – Ether