Solved

Import Excel worksheet into Delphi StringGrid

Posted on 2010-08-30
3
2,163 Views
Last Modified: 2012-05-10
Ok, I've got

Procedure foo;
var
    FExcel : Variant;
begin
    FExcel:=CreateOleObject('Excel.Sheet');
    FExcel.Application.Workbooks.Open('c:\test.xlsx');


What lines do I need to add to:
Select a worksheet in Excel
Copy the raw data from that sheet into a delpgi string grid ?

Code example wanted please

ta.

0
Comment
Question by:WeeStinker
3 Comments
 
LVL 10

Expert Comment

by:GlobaLevel
ID: 33563202
dont know enough about Delphi..

is it for the current worksheet"

Sheets("Sheet1').activate
'number of ways to select...

' for exxcel 2003...excel 2007 has 1,044,xxx rows...
Range("A1:ZZ66000").select

i dont know how you would paste into delphi...you may have to write an ado sql command to query the excel the insert into delphi via a recordset...
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 33563218
I don't know much about Delphi either, looks a bit like Pascal which I did back in the dark ages lol.
How about the code snippet here, would that help? http://www.swissdelphicenter.ch/torry/showcode.php?id=1728
0
 

Author Closing Comment

by:WeeStinker
ID: 33563224
Perfect, that links to just the codee I want.

Thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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