This function is supposed to tell you how many rows/lines are in a table. Has anyone (Joe) [img]/images/graemlins/wink.gif[/img] used this successfully before? It always returns 0 for me.
- I made sure I had the sheet closed.
- I was getting an error till I started using the column letter instead of the number.
- I put display/debug statements in the code and found there is nothing in tab_data$() array.
- I used the other excel functions and they work fine.
I did notice this function doesn't pass the "workbook" parameter like all the other excel function. I also noticed Maxline was capitalized in the function signature, but not in the function body, but fixing that did nothing.
I'm writing a work-around and contacting the company.
Sorry about that Joe. Thanks for the response. It is a sample function they give in the help/doc. Here's the response from WinTask: (I though I tried with "workbook 1", but I guess not)
Our function in the help assumes Sheet1, that's why you don't succeed. Here is the function if you specify in Workbook$ the name of the sheet:
function nb_line_excel(excel_file$,column$,start_line,maxli ne)
local ret, i , sortie
ret=ReadExcel(excel_file$,workbook$+"!"+column$+st r$(start_line)+":"+column$+str$(maxline),tab_data$ ())
if rtrim$(ltrim$(tab_data$(i)))<>"" then
until sortie=1 or i=maxline
It's solved. Thanks for checking. It was the "workbook" issue. I needed to look at the API for excel, but I guess I was thinking the ReadExcel/WriteExcel function links in the “Excel useful functions” example page went to the “write_excel_data” and “retrieve_excel_data” functions on that same page. Doh!
I just gave the proof-of-concept and management loved it. They were blown away...such a good feeling.