Using perl Syntax Highlighting
- use strict;
- use Win32::OLE;
- use Win32::OLE qw(in with);
- use Win32::OLE::Variant;
- use Win32::OLE::Const 'Microsoft Excel';
- #### File location
- my $Filename = ('C:\xxx\excel.xlsx');
- #### Open Excel
- my $Excel = Win32::OLE->new('Excel.Application', 'Quit');
- # $Excel->{SheetsInNewWorkbook} = 0;
- my $Book1 = $Excel->Workbooks->Open($Filename) || die("Could not open file!");
- my $Sheet1 = $Book1->Worksheets(1);
- $Book1->SaveAs({Filename =>'C:\xxxx\Salida.txt', FileFormat => xlTextMSDOS});
- print "resulto!";
- #### Close
- $Book1->Close;
- $Excel->Quit;
Coloreado en 0.002 segundos, usando GeSHi 1.0.8.4
Gracias, amigo, por tu ayuda.
Saludos.