I have Excel 2007 installed but I need to save my excel file as a .xls, compatible with Excel 2003. My code doesn't seem to be working, it won't recongnize the SaveAs and prompts to save "Book1" any help would be appreciated
use Win32; use Win32::OLE; $excelFile = "c:\\perl\_scripts\\printVersions\\dest\\NMSPrintVersions +.xls"; $xlApp = Win32::OLE->new('Excel.Application'); $xlApp->{Visible} = 0; $xlBook = $xlApp->Workbooks->Add; $sheet = $xlBook->ActiveSheet; $range = $xlBook->ActiveSheet->Range("A1:C1"); $title = ["FILENAME","VERSION","DATEUPDATED"]; $range ->{value} = $title; $sheet->Columns("B:B") -> {NumberFormat} = "#0.0"; $count=1; foreach (@array) { ($one, $two, $three) = split('\,', $_); $mydata = ["$one", "$two", "$three"]; $count++; $range = $xlBook->ActiveSheet->Range("A$count:C$count"); $range->{Value} = $mydata } unlink ($excelFile); #$xlBook->SaveAs($excelFile); $xlBook->SaveAs({Filename=>"$excelFile",FileFormat=>xlExcel9795}); $xlBook->Close(); $xlApp->Quit();
In reply to Win32::OLE - Excel, Can't save as Previous Version by JaySal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |