No, don't double-post.
I have now deleted the old post.
Anyway, why don't you use fpspreadsheet?
Because I simply can't get fpspreadsheet to do what I want. I have already spent hours trying, following the guidance you quote. As I came across a bit of code using OLE that worked first time, why not use it and save myself a lot of time and trouble? Excel will always be installed on our system, because we use it for data entry. All I want from my program is to read a worksheet created with Excel itself; then process the data, and insert it after modification into a sqlite table. Moreover my final program will not display the Excel data in a grid at all, so whether that can be done with or without code is irrelevant. The grid is simply a feature of the example in the wiki. All I am trying to do now is what I said, add the ability to select a specific worksheet to the existing code in the wiki. Once I get that going I re-use the relevant bits of code in my own program.
Thank you for the working code you have provided, I shall have to try to work out why the version I was using did not work, especially why I got the error
Method 'WorkSheets' is not supported by Automation Object
when your code uses that method successfully.
I do have one question though. The first time in a programming session that I run the program (both my original version and yours), I get an OLE error "The specified module could not be found" (the Comobj unit, maybe ?). The second time I run it, with no modification, I get no such error. If I close the project and re-open it, I do not get the error again. Is there something I can do to fix this ?
Many thanks
Caravelle