Klaus Eichner > Win32-Scsv > Win32::Scsv

Download:
Win32-Scsv-0.14.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.14   Source  

NAME ^

Win32::Scsv - Convert from and to *.xls, *.csv using Win32::OLE

SYNOPSIS ^

    use Win32::Scsv qw(
      xls_2_csv csv_2_xls xls_2_vbs slurp_vbs empty_xls get_xver
      open_xls_book open_xls_sheet get_last_row get_last_col open_excel
    );

    my ($ver, $product) = get_xver;

    xls_2_csv('Test1.xls');
    xls_2_csv('Test1.xls' => 'dummy.csv');
    csv_2_xls('dummy.csv' => 'Test2.xls');
    xls_2_vbs('Test1.xls' => 'dummy.vbs');
    empty_xls('Test2.xls');

    say $_->{'NAME'}, ' => ', $_->{'CODE'} for @{slurp_vbs('Test3.xls')};

    csv_2_xls('dummy.csv' => 'New.xlsx%Tab9', {
      'tpl'  => 'Template.xls',
      'prot' => 1,
      'csz'  => [
         ['H:H' => 13.71],
         ['A:D' => 3],
      ],
      'fmt'  => [
         ['A:A' => '#,##0.000'],
         ['B:B' => '\\<@\\>'],
         ['C:C' => 'dd/mm/yyyy hh:mm:ss'],
      ],
    });

    my $ob = get_book('Test01.xls');
    my $os = $ob->Worksheets('Sheet5') or die "Can't find Sheet";

    my $last_row = get_last_row($os);
    my $last_col = get_last_col($os);

    say 'last row = ', $last_row, ', last col = ', $last_col;

    $ob->Close;

    open_excel('C:\Data\Test01.xls');

AUTHOR ^

Klaus Eichner <klaus03@gmail.com>

COPYRIGHT AND LICENSE ^

Copyright (C) 2009-2011 by Klaus Eichner

All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the artistic license 2.0, see http://www.opensource.org/licenses/artistic-license-2.0.php

syntax highlighting: