Dde_execute an excel macro from prolog. How do I pass parameters to the macro?

Hi experts,

Could someone help to solve my question? Here I want to execute an Excel VBA macro, called execute_demo from Swi prolog DDE.
Without parameters, it runs well and return True.
But, I need to pass parameters into the macro. I tried many possible combination but fail, such as dde_execute(C,’[run(“execute_demo 1”)]’).

I don’t have any clues to do it. Can anyone help to shed light on it?

Thank you for your helps in advance.

Excel vba:

Public sub execute_demo( i as integer)
  msgbox(i)
end sub

SWI prolog:

run_excel_macro() :-
      open_dde_conversation('Excel','[swipl_excel.xlsm]S',C),
       dde_execute(C,'[run("execute_demo")]'),
       close_dde_conversation(C).

A quick check tells me that dde_execute/3 simply passes the command as a string to Windows DDE API. Thus, this seems more a question about using Excel through DDE than a Prolog question.

Dear Jan,
Thank you for the replying. Checking SWI prolog manul, there is dde_execute/2, not dde_execute/3. Is it undocumented for dde_execute/3?

Thanks,
John Lin

My mistake. It is /2.