Solved

Delphi Excel connection

Posted on 2016-08-16
3
31 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 36

Accepted Solution

by:
Geert Gruwez earned 250 total points (awarded by participants)
Comment Utility
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)
Comment Utility
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
Comment Utility
Good comments and suggestions made but no author ferdback
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

771 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

9 Experts available now in Live!

Get 1:1 Help Now