Solved

ADO and Excel file locked for editing

Posted on 2009-05-04
1
455 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:Dennis_Treacy
1 Comment
 

Accepted Solution

by:
Dennis_Treacy earned 0 total points
ID: 24302542
Problem solved - I did not disconnect from Excel after getting a list of worksheet names
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now