lori0825 has asked for the wisdom of the Perl Monks concerning the following question:
Please kindly help to solve this question... Thanks a lot.## use Win32::OLE qw(in with); use Win32::OLE::Const; use Win32::OLE::Const 'Microsoft Excel'; my $Excel = Win32::OLE->new("Excel.Application"); ........ ....... ....... $Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Open($bom_file_directory); # select worksheet number 1 (you can also select a worksheet by name) my $Sheet = $Book->Worksheets(1); my $new_bom_txt = "c:/valor/tmp/value.txt"; my $out_format = "\"xlText\""; if ( -e $new_bom_txt) { unlink $new_bom_txt; } # $Sheet->SaveAs( $new_bom_txt )->FileFormat = "xlText"; $Sheet->SaveAs( { 'FileName' => $new_bom_txt , # 'FileFormat' => $out_format} ); $Book->Close(); $Excel->Quit; ...........
Edited by Chady -- code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to save a text file from excel
by tachyon (Chancellor) on Jul 08, 2004 at 02:19 UTC | |
|
Re: How to save a text file from excel
by knoebi (Friar) on Jul 08, 2004 at 07:36 UTC |