Here is a sample script that shows how to run a macro called Macro1:
proc main
long LinkVar, SystemVar ;Variables containing DDE Id's.
;Set up DDE links to Excel's system and a spreadsheet. Excel
;must be running in order for this script to work properly.
if ddeinit SystemVar "excel" "system"
ddeexecute SystemVar "[FULL(TRUE)]" ;Maximize the spreadsheet.
if ddeinit LinkVar "excel" "sheet1" ;Set up link to spreadsheet.
ddeexecute LinkVar "[RUN(`"Macro1`")]"
ddeterminate LinkVar ;Break DDE link to spreadsheet.
ddeterminate SystemVar ;Break DDE link to Excel.
else
errormsg "Couldn't establish DDE link to spreadsheet!"
endif
else
errormsg "Couldn't establish DDE link to Excel!"
endif
endproc