Code: Select all
#include once "xlhelper.bas"
xlstart (1,FALSE) 'initialize Excel, 1 sheet, not visible
xlopen(curdir & "\" & "My_Excel", FALSE) 'Open file, not visible
Print Val(xlgetvalue(1,2))
xlquit
xlrelease
sleep
Code: Select all
#include once "xlhelper.bas"
xlstart (1,FALSE) 'initialize Excel, 1 sheet, not visible
xlopen(curdir & "\" & "My_Excel", FALSE) 'Open file, not visible
Print Val(xlgetvalue(1,2))
xlquit
xlrelease
sleep
Code: Select all
xlco("Excel.Application", NULL, @xlApp)
Code: Select all
#include once "xlhelper.bas"
xlopen(curdir & "\" & "My_Excel", FALSE) 'Open file, not visible
Print Val(xlgetvalue(1,2))
xlquit
xlrelease
sleep
Code: Select all
#include once "FB_Lib\xlhelper.bas"
xlopen (curdir & "\Test_Excel.xlsx", TRUE) 'Open file, not visible
print "completed xlopen"
print xlgetvalue(1,1)
sleep
xlquit
print "completed xlquit"
sleep
shell "taskkill /F /IM EXCEL.EXE"
print "complete kill"
sleep
Code: Select all
xlpv(xlApp, ".Visible = %b", FALSE)
Code: Select all
'xlhelper.bas test, multiple instances
'' Does excel.exe remain after xlquit() & xlrelease()
'' Compile as console prog.
'' Tested Win10 64bit, Excel 2013/16, FB 1.05.0 (01-31-2016), built for win32 (32bit)
'
#include "xlhelper.bas"
'
'create 2 placeholder structures, 1 for each
'' book we are opening or creating
dim as IDispatch ptr book1,book2
'
'create 1st book
xlstart()
print "start book1 xlapp = ";xlapp
book1=xlapp 'store book1 pointer
'
sleep 2000
'
'create 2nd book
xlstart()
print "start book2 xlapp = ";xlapp
book2=xlapp 'store book2 pointer
'
sleep 2000
'
xlapp=book1 'set internal pointer to book1
xlquit()
xlrelease()
print "End book1 xlapp = ";xlapp
'
xlapp=book2 'set interal pointer to book2
xlquit()
xlrelease()
print "End book2 xlapp = ";xlapp
'
print
print "Exit in 5 seconds....."
sleep 5000