Dennis_Treacy
asked on
ADO and Excel file locked for editing
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.