Solved

Import Excel worksheet into Delphi StringGrid

Posted on 2010-08-30
3
2,087 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

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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