By using the example database, there are many ways to handle Microsoft Excel documents.
I was wondering if there is a way to remove rows from Excel?
We receive a Excel file that needs to be move to another directory, rename and opened.
Once open, the first 3 rows must be removed completely to leave just the header fields and the data.
This is then imported to a database. What I’m looking to do with Xojo, is being able to take this file,
move it to another directory and remove the first 3 rows.
Eugene,
IMHO that doesn’t remove the rows but just clears them.
Easiest way to acomplish what the OP wants is to give the the datarange Including the fieldnames a RangeName, e.g. “DBExcel”.
Then open the Excel file with an ODBC connector and then the database is visible with that name and fieldnames.
In this case you don’t have to remove lines and the named range can be anywhere in the Excel model.
Hi Andre. Yes, you are right, the example I gave clears the rows and leaves the header files and empty places for the data which is what I believe the OP wanted. I could have misinterpreted this request.
If the Delete command is used then the rows, header files, and empty data fields are removed, which I believe the OP does not want:
XL.Rows("1:3").Delete
I like your suggestion about using an ODBC connector and had not thought about this functionality - well done!