Nalina has asked for the wisdom of the Perl Monks concerning the following question:
ASP code isuse Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; use Win32::OLE::NLS qw(:LOCALE :DATE); use Win32::OLE; use Win32::OLE::Const; $Win32::OLE::Warn = 3; # die on errors... my $filter = 'PNG'; # can be GIF, JPG, JPEG or PNG $filename = "C:\\graph1.xls"; my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); # use the Exc +el application if it's open, otherwise open new my $Book = $Excel->Workbooks->Open( $filename ); # open the fi +le foreach my $Sheet (in $Book->Sheets) { # loop through all shee +ts foreach my $ChartObj (in $Sheet->ChartObjects) { # loop throug +h all chartobjects in the sheet #$pngsave = join("",split(/\s+/,$graphtitle)); $dirpath = "c:\\Tt"; mkdir ("$dirpath", 0777); my $savename = "$dirpath\\test" . ".$filter"; #check out the +variable name # Write image to PNG file $ChartObj->Chart->Export({ FileName => $savename, #check out t +he variable name FilterName => $filter, Interactive => 0}); } }
This works in some systems & doesn't in some. Its not giving any error.<html> <body> <form action = "disp.asp" method = post> Enter a Value <input type = "text" name = "fname" size = 20> <input type = "submit" value = "click"> </from> <% dim nm nm = request.form("fname") if nm <> "" then response.write("<center> <br> hi "& nm &"</center>" ) response.write("<center> <br> have a good start </center +>") set shell = Createobject("wscript.shell") shell.run "cmd.exe /c C:\\Perl\\bin\\perl " & nm, 1, 1 set shell = nothing end if %> </body> </html>
Considered by jdporter - Retitle: "ASP -> Shell -> Perl -> Excel doesn't seem to work"
Unconsidered by castaway - Keep/Edit/Delete: 9/16/0 - Looks fine to me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl, Win32::OLE, ASP
by gellyfish (Monsignor) on Mar 22, 2005 at 09:11 UTC | |
|
Re: Perl, Win32::OLE, ASP
by FitTrend (Pilgrim) on Mar 22, 2005 at 14:09 UTC |