The rest of your code looks ok, but this line is wrong:
my $Client = new Win32::DDE::Client ('C:\\Program Files\\Microsoft
Office\\Office\\excel.exe', 'C:\\Inetpub\\wwwroot\\datasource.xls');
When you initiate a DDE session, there are a few things to look out for.
First, the app you're talking to must have at least one instance running at
the time. Also, in the DDE connection request, you have to specify the
name of the program running (and possibly its instance), and the type of
connection you want. I'm not familiar with interfacing with Excel through
DDE, but the line should look more like this:
my $Client = new Win32::DDE::Client ('Excel1', 'Form1');
where 'Excel1' is the name of the instance of Excel that you want. IIRC,
each copy that is running is named Excel plus a number between 1 and the
number of instances of Excel, in the order that they were started.
The 'Form1' portion of the request is the topic of the conversation, in
this case, a connection to a worksheet named Form1.
Also, make sure to close the DDE connection when you're done with it (at
program exit or whatever) or you'll eventually run into major memory-leak
problems. Hope this helps!
John
---
You are currently subscribed to perl-win32-users as: [[email protected]]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]