jarlakhnet has asked for the wisdom of the Perl Monks concerning the following question:
Here the File(Report_Temp.xls) was written by another Script using the Spreadsheet::WriteExcel module, Now I want to use Win32::Ole to write a sample data in the respective file, So I will call the above subroutine to invoke it but it throws the above error.#!C:/Perl/bin/perl.exe use strict; sub Export_Excel{ use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Win32::OLE::Warn = 3; # die on errors... my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); my $Book = $Excel->Workbooks->Open("D:\\Application\\tmp\\Report_Temp. +xls"); my $Sheet = $Book->Worksheets('Report_Temp'); $Sheet->Cells(15,2)->{'Value'}=''; $Sheet->Cells(15,1)->{'Value'}='Test Successfully'; $Book->Save(); $Book->Close; $Excel->quit(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with Win32::OLE in the CGI Mode
by Amar (Sexton) on Nov 07, 2005 at 15:10 UTC | |
|
Re: Problem with Win32::OLE in the CGI Mode
by Anonymous Monk on Jan 17, 2006 at 14:26 UTC |