[comp.windows.ms] Execute Excel commands from an external program

newsuser@LTH.Se (LTH network news server) (12/20/88)

I am trying to excute commands in Excel from an other window program.

As I understand it I should first send a WM_DDE_INITIATE to all
windows like this:

	wDDEServer = GlobalAddAtom ("Excel");
	wDDETopic = GlobalAddAtom ("System");
	SendMessage(0xFFFF, WM_DDE_INITIATE, hWnd,
		    MAKELONG(wDDETopic, wDDEServer));

And then I should wait for a WM_DDE_ACK from Excel (which should be
the only window answering for these parameters) and extract HWND
handle for the Excel window. Then I can send WM_DDE_EXECUTE messages to
that specific HWND for Excel and it will hopefully work... :-)

Now, the problem is that Excel will not answer the WM_DDE_INITIATE
message. I have used "spy" to verify that Excel really gets the
message, but it doesn't respond.


Anyone knowing what is wrong? I am using MS-Windows 2.03 and
corresponding version of Excel (2.1?, > 2 I am sure, but I dont have
the manuals with me at home).

I would be very pleased for any comment on this matter!

/Richard
_______________________________________________________________________________
Richard Niklasson             ! INTERNET: rn@tts.lth.se 
Dept of Communication Systems ! DUMB ARPA MAILERS: rn%tts.lth.se@uunet.uu.net
Lund Institute of Technology  ! UUCP: ...!<uunet,mcvax,munnari>!enea!tts.lth!rn
Box 118                       ! EARN/BITNET: erlangrn@seldc51
S-221 00  LUND                ! VAXPSI: psi%24020031020720::erlang::rn
Sweden                        ! PHONE: int+46 46 109008  FAX: int+46 46 145823
-------------------------------------------------------------------------------