Solved

Import Excel worksheet into Delphi StringGrid

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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