Solved

Delphi Excel connection

Posted on 2016-08-16
3
39 Views
Last Modified: 2016-09-10
I have connected Delphi to an Excel workbook usibng Ado. I can see the spreadsheet in Delphi DB Grid. But how in code do I refer to an Excel cell? So in Excel sheet 1 column is F18, and the row is 5, How do I retrieve the value of this cell to use in, say, an edit box?
0
Comment
Question by:Nicholasjf
  • 2
3 Comments
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 250 total points (awarded by participants)
ID: 41758998
There is a complete manual for delphi and excel on about.com
http://delphi.about.com/od/database/l/aa090903a.htm

getting field info is in page 4
http://delphi.about.com/od/database/l/aa090903d.htm

and editing, modifying is in page 4
http://delphi.about.com/od/database/l/aa090903e.htm

basically you can query an excel spreadsheet using an ado table
and update/edit it via a dbgrid or sql updatestatements
0
 
LVL 17

Assisted Solution

by:xtermie
xtermie earned 250 total points (awarded by participants)
ID: 41765207
like this , for example:

procedure TForm1.HandleData;
var
  Sheet: Variant;
  i: Integer;
begin
  Sheet := XLApp.Workbooks[1].Worksheets['Delphi Data'];
  for i := 1 to 10 do
    Sheet.Cells][i, 1] := i;
end;

Open in new window

0
 
LVL 17

Expert Comment

by:xtermie
ID: 41792472
Good comments and suggestions made but no author ferdback
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

861 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

22 Experts available now in Live!

Get 1:1 Help Now