CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Excel doesnt show up

 



atulbhai
newbie

Nov 22, 2001, 3:12 AM

Post #1 of 3 (4779 views)
Excel doesnt show up Can't Post

Hi Perl Champs,

following statement creates new instance of excel application. But i dont see any excel being activated on my desktop?
any idea why so and what went wrong? useful pointers will be highly appreaciated.

$ex = Win32::OLE->new('Excel.Application') or die "oops\n";

thanks a lot,
-atul.



fashimpaur
User

Dec 3, 2001, 12:25 PM

Post #2 of 3 (4769 views)
Re: Excel doesnt show up [In reply to] Can't Post

You might want to try to make it visible.

Try this example and then see if it doesn't do what you are trying to accomplish.

use Win32::OLE;
use Win32::OLE::Const;
my $ex = Win32::OLE->new('Excel.Application');
my $xl = Win32::OLE::Const->Load($ex);
$ex->{Visible} = 1;
$x = 0;
$book = $ex->Workbooks->Add();
$sheet = $book->Worksheets(1);
$row = 1;
while ($x < 1000) {
for ($col = 1; $col <= 10; ++$col){
$sheet->Cells($row,$col)->{Value} = $x;
$x += 1;
}
$row++;
}
$book->SaveAs("c:/perl.xls");
$ex->Quit;

Dennis

$a="c323745335d3221214b364d545a362532582521254c3640504c37292f493759214b3635554c3040606a0",print unpack"u*",pack "h*",$a,"\n\n"


Panjka
stranger

Dec 5, 2001, 11:41 PM

Post #3 of 3 (4765 views)
Re: Excel doesnt show up [In reply to] Can't Post

Thank you, Dennis!

This morning I was going to post practically the same question to the Forum (When using Win32::OLE, I could not see the Internet Explorer window, although the OLE object was generated successfully and I could access its methods). And how great it is when you have the answer before asking the question itself!

Pavel (Panjka).


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives