Delphi 2009 & Excel 2007

Posted on 2010-01-06
Last Modified: 2012-05-08
How do I read/write data from/to a excel document that was created in Excel 2007?

I have looked at I have search google, but the examples is only for older version of delhi and excel.
Question by:QC20N
    LVL 22

    Expert Comment

    by:Ferruccio Accalai
    Reading/writing  is done in almost the same way as for previous versions, except for the Extended property part of the connection string.
    So use the same example you posted in the other question and adjust it using the proper string in Extended property from this site

    Author Comment

    Yes, the connectionstring in the link I allready use. I was hoping that someone could show me some examples on how to use Excel_TLB. As I understand there is several ways to communicate with excel.
    LVL 22

    Expert Comment

    by:Ferruccio Accalai
    The best way to read/write Data is using ADO.
    BTW to create or menage Worksheet using the type library you could follow this example, From D6 to D2009 it's almost the same.

    Author Comment

    Ok, but how do you control color, fontsize and font by using Excel_tlb?
    LVL 22

    Accepted Solution

    Yes you can.
    If I can remember, once you have your worksheet assigned using like
     WS := WBk.Worksheets.Item['Sheet1'];
    then you could get or store fonts and colors of range of cells assigning values like this

    with WS.Range['B1', 'C10'].font do
          Size := 20;
          FontStyle := 'Bold';
          Color := clFuchsia;
          Name := 'Arial';

    Not tested, but this should work

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    728 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

    18 Experts available now in Live!

    Get 1:1 Help Now