in reply to Creating an excel document from hashes
Hi rahulruns!
If you are in a windows environment, you could use Win32::OLE. Your code could look similar to the following:
See Using Win32::OLE and Excel - Tips and Tricks for more information. HTH, Ratause Win32::OLE::Const 'Microsoft Excel'; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); my $book = $Excel->Workbooks->Open($template); my $Sheet = $book->Worksheets($destinationSheet); my $y = 2; foreach my $k (keys %yourHash) { $Sheet->Range("B$y")->{Value} = $k; # title $Sheet->Range("C$y")->{Value} = $yourHash{$k}; # value $y++; }
|
|---|