break on cls
;------------------------------------------------
; OLE Formula 1 Driver (hehe)
;
; Enter "quit" to quit
;------------------------------------------------
; Create an instance of Excel (excel.exe)
$excel = olecreateobject ( "excel.application" )
if $excel = 0
?"Excel (ole) is not supported on this machine"
exit
endif
; Comment/Uncomment next line for the visuals
; Remember to re-focus back to your DOSBOX if you do
; $rs = oleputproperty ( $excel, "visible", "b", "1" )
; Disable alerts (i.e. don't ask if I want to save my work)
$rs = oleputproperty ( $excel, "displayalerts", "b", "0" )
; Get a handle to the workbooks object
$workbooks = val("&"+olegetproperty ( $excel, "workbooks" ))
; Open a new workbook & sheet
$rs = olecallfunc ( $workbooks, "add" )
; Get a handle to the default active cell (A1)
$cell = val("&"+olegetproperty ( $excel, "activecell" ))
while 1
?
?"Formula : " gets $formula
if $formula = "quit" goto finish endif
$rs = oleputproperty ( $cell, "formula", "s", "=$formula" )
?"Answer : " olegetproperty ( $cell, "value" )
loop
:finish
$rs = olecallfunc ( $excel, "exit" )
$rs = olereleaseobject ( $excel )
?
?"Use taskmgr.exe to manually terminate excel.exe"
?
exit