I want to open an excelfile with a call to a function that is declared like this: DECLARE(ExcelOpen, DLL, (const char* szBook), int). I don't know C but I tried to place the excelfile in the same map as the app and just called with: XLS_Open("t.xlsx") but it doesn't work. Its a program in the Showroom/page 7/Excel interface.
Have you tried putting the excel file in the media directory ?
Yes. XLS_Init(TRUE) // Yes, show excel
//XLS_NewWorkBook()
XLS_Open("t.xlsx")
XLS_SetActiveSheet(2)
XLS_SetCell(1,1, "5")
XLS_SetCell(1,2, "10")
XLS_SetCell(1,3, "=" + XLS_CellName$(1,1) + "+" + XLS_CellName$(1,2))
LOCAL string$
XLS_GetCell(1,3, string$)
STDOUT "reading: "+string$+"\n"
KEYWAIT
XLS_Quit()
Either it open a new file or, if I try to open on the first line, I get "NULL passed to autowrap"
Did you try an old .xls? I dont think that old code supports the more modern .xlsx, if it still runs at all...
It can be so but I want to manipulate new files so install an old version is not an alternativ. Interesting though that it is possible to do.
New version of MS Office usually can also save to old file format. May be worth to at least try it.
I tried saving as 2003 xls but can't get it to work. Think I give up, but thanks anyway.
work in:
c:\users\<your user name>\documents\t.xls
Ciao
I tried to put that in as a string but i got syntax error. The compiler seems to not accept absolut adresses in a string.
Try:
address$="D:\\APPOGGIO\\Basic\\glbasic10\\code\\GLBasic\\Excel\\t.xls"
XLS_Open(address$)
Thanks a lot, it works.
Strange that you can't put a single "\" in a string.
The \ is an escape character. You have to \\ to escape a single \.