View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bmm bmm is offline
external usenet poster
 
Posts: 10
Default DDE excel and VC:Urgent

Iam trying to run a program which activates one of the sheet of the workbook
and trying to Poke data in to the most active sheet.
But every poke statement is putting data in to sheet 1 only.

the code snippet is:
char szItem3[] = "R3C1";
char szDatasheet1[] = "Data to sheet1";
char szSheet1[]="[WORKBOOK.ACTIVATE(\"sheet1\")]" ;
DDEExecute( idInst, hConv, szheet1);
Sleep(3000);
DDEPoke(idInst, hConv, szItem3, szDatasheet1);
Sleep(3000);

char szDatasheet2[] = "Data to sheet2";
char szSheet2[]="[WORKBOOK.ACTIVATE(\"sheet2\")]" ;
DDEExecute( idInst, hConv, szSheet2);
Sleep(3000);
DDEPoke(idInst, hConv, szItem3, szDataSheet2);