Solved

Import Excel worksheet into Delphi StringGrid

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

11 Experts available now in Live!

Get 1:1 Help Now