ADO and Excel file locked for editing
Posted on 2009-05-04
I am using ADO to import Excel data into an ADO Table and DBGrid.
The problem I have arose since moving from Delphi 7 to Delphi 2009.
I can connect to the Excel workbook and select any worksheet on the first try. But if I leave my import wizard and return immediately to it , I cannot select a worksheet other than the first worksheet.
After doing this, if I then open the Excel file using Excel I get the message that the file is locked for editing. The designated user is myself.
The only way I can connect to the Excel file a second time, and select any worksheet, is to close and reopen my application.
The original Excel file has no security protection or locked cells
I have ensured that the ADO Table is closed when leaving the Wizard.