MS Excel Automation in Delphi

In this blog I will describe how to read and write data from and to an Excel file. Sometime in our application we use Excel for reporting purpose, for data import / export purpose and for other works. So here I will explain how to access an Excel file and use for data read / write.

For this Excel 2003 or later should have installed in our system.

First use Excel2000 unit to uses clause. This unit comes with Delphi installation it self. You can get the unit in installed path
C:\Program Files (x86)\Embarcadero\RAD Studio\10.0\OCX\Servers

Uses
   Excel2000;

Before proceed I would mention an important word LCID which is required at most places. So what it LCID?

LCID = In Microsoft Excel, the LCID indicates the currency symbol to be used when this is an xlListDataTypeCurrency type. Returns 0 (which is the Language Neutral LCID) when no locale is set for the data type of the column.

We can get LCID in Delphi by using GetUserDefaultLCID function..

private    
    LCID: Cardinal;
.........
//assigned on form create//
    LCID := GetUserDefaultLCID;

And now following are the codes used to access, read, write and format an Excel file.

First declare following variables...


private
  ExcelApp: TExcelApplication;
  myxlBook: TExcelWorkbook;
  myxlSheet11: TExcelWorksheet;
  myxlSheet12: TExcelWorksheet;  

Now write codes using above variables on a Button click or other appropriate event.

1. Create and connect with an Excel Application...
    myxlApp := TExcelApplication.Create(Nil);
    myxlApp.Connect;
    myxlApp.Visible[LCID] := True; // will show newly connected Excel application // most of case not required //

2. Close and Free the Excel application....
    myxlApp.Disconnect;
    myxlApp.Quit;
    FreeAndNil(myxlApp);

3. Add a Workbook
    myxlApp.Workbooks.Add(EmptyParam, LCID); //it will also add a default sheet to workbok//
    myxlBook := TExcelWorkbook.Create(myxlApp);
    myxlBook.ConnectTo(myxlApp.ActiveWorkbook);

4. Disconnect Workbook before close
    myxlBook.Close(True,'C:\jitendra\ExcelTest1.xlsx'); //Saves the changes to mentioned file//
    myxlBook.Disconnect;
    FreeAndNil(myxlBook);
5. Add new Worksheet
    myxlSheet11 := TExcelWorksheet.Create(myxlBook);
    myxlSheet11.ConnectTo(myxlBook.ActiveSheet as _worksheet); //connecting with the default worksheet//
    myxlSheet11.Name := 'Class 11';

6. Disconnect worksheet before close
    myxlSheet11.Disconnect;
    FreeAndNil(myxlSheet11);
7. Adding a new Worksheet to the Workbook
myxlBook.Worksheets.Add(EmptyParam, EmptyParam, EmptyParam, EmptyParam, LCID);
    myxlSheet12 := TExcelWorksheet.Create(myxlBook);
    myxlSheet12.ConnectTo(myxlBook.ActiveSheet as _worksheet);
    myxlSheet12.Name := 'Class 12';

8. Access Sheets by Index or Name
(myxlApp.Worksheets[0] as _Worksheet).Activate(LCID);
Or
(myxlApp.Worksheets['Sheet1'] as _Worksheet).Activate(LCID);
9. Assign values to Cell by using Cell or Range property
    myxlApp.Cells.Item[1,1] := 'Value 1'; //with row, col number//

    myxlApp.Range['A3','A3'].Value := 'value 2'; //with cell from, to names//

    myxlSheet11.Cells.Item[1,5] := 'JITENDRA'; //with row, col number//

    myxlSheet11.Range['E3','E3'].Value := '7834911261'; //with cell from, to names//
10. Change font format of an Excel Range
    with myxlSheet11.Range['A1', 'B3'] do
    begin
      Font.Name := 'Verdana';
      Font.Size := 15;
      Font.Bold := True;
      Font.Strikethrough := True;
      Font.Color := clRed;
    end;
11. Change Background Color of cells
    with myxlSheet11.Range['A1', 'A1'].Interior.Color := clYellow;
myxlSheet11.Range['A5', 'D7'].Merge(False);// merge cells and fill color in merged cells//
myxlSheet11.Range['A5', 'D7'].Interior.Color := clRed;
12. Merge Cells in a range
    myxlSheet11.Range['A5', 'D7'].Merge(False); //False by default if True it would merge cells row by row//
    myxlSheet11.Range['A5', 'D7'].Value := 'Merged data';
13. Change Column width and Row height
    myxlSheet11.Range['B5', 'B5'].ColumnWidth := 5; //single column B//
    myxlSheet11.Range['J5', 'L8'].ColumnWidth := 15; //multiple column J,K,L//

    myxlSheet11.Range['B5', 'B5'].RowHeight := 50; //single row 5//
    myxlSheet11.Range['J10', 'J15'].RowHeight := 50; //multiple row 10-15//

14. Open the workbook that already exists: 
myxlApp.Workbooks.Open ( 'C:\jitendra\ExcelTest1.xlsx'
EmptyParam , EmptyParam , EmptyParam , EmptyParam ,
EmptyParam , EmptyParam , EmptyParam , EmptyParam ,
EmptyParam , EmptyParam , EmptyParam , EmptyParam , 0 );
15. Copy and Paste Data from one cell to another in same sheet...
a. 
myxlSheet11.UsedRange[LCID].Copy(myxlSheet11.Range['J10', 'J10']);
myxlSheet11.Range['A5', 'D7'].Copy(myxlSheet11.Range['J10', 'J10']);
b. 
       myxlSheet11.UsedRange[LCID].Copy(EmptyParam);
       myxlSheet11.Range['J10', 'J10'].PasteSpecial(xlPasteAll,                xlPasteSpecialOperationNone, EmptyParam, EmptyParam);
myxlSheet11.Range['A5', 'D7'].Copy(EmptyParam);
    myxlSheet11.Range['J10', 'J10'].PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone, EmptyParam, EmptyParam);
16. Copy and Paste Data from one Sheet to another sheet.
a. 
myxlSheet11.UsedRange[LCID].Copy(myxlSheet12.Range['J10', 'J10']);
myxlSheet11.Range['A5', 'D7'].Copy(myxlSheet12.Range['J10', 'J10']);
b. 
    myxlSheet11.UsedRange[LCID].Copy(EmptyParam);
    myxlSheet12.Range['J10', 'J10'].PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone,EmptyParam, EmptyParam);
myxlSheet11.Range['A5', 'D7'].Copy(EmptyParam);
    myxlSheet12.Range['J10', 'J10'].PasteSpecial(xlPasteAll, xlPasteSpecialOperationNone,EmptyParam, EmptyParam);
17. Insert new columns before b1
myxlSheet11.Range['b1', 'b1'].Columns.Insert(xlShiftToRight); // we can use xlShiftToLeft//
18. Insert new rows above b2
myxlSheet11.Range['b2', 'b2'].Rows.Insert(xlShiftDown); // we can use xlShiftUp//

19. Clear a Selected Range Content or Format
    myxlSheet11.Range['b3', 'b10'].ClearContents;
    myxlSheet11.Range['b3', 'b10'].ClearFormats;

20.Save, Save as a Sheet / Workbook
    myxlSheet11.SaveAs('Filename');
    myxlBook.Save;
21. Print Preview / Print of a Sheet / Workbook
    myxlSheet11.PrintPreview;
    myxlSheet11.PrintOut;
    myxlBook.PrintPreview;
    myxlBook.PrintOut;
22. Set Sheet PageSetup
myxlSheet11.PageSetup.
A. header: 
myxlSheet11.PageSetup.CenterHeader := '' The report shows '' ;
B. footer: 
myxlSheet11.PageSetup.CenterFooter := '' The & P '' ;
The C. header into the top margin 2cm: 
myxlSheet11.PageSetup.HeaderMargin := 2 / 0.035 ;
D. footer bottom margin 3cm: 
myxlSheet11.PageSetup.HeaderMargin := 3 / 0.035 ;
E. top margin 2cm: 
myxlSheet11.PageSetup.TopMargin := 2 / 0.035 ;
The bottom edge of the f. from the 2cm: 
myxlSheet11.PageSetup.BottomMargin := 2 / 0.035 ;
G. left 2cm: 
myxlSheet11.PageSetup.LeftMargin := 2 / 0.035 ;
On the right side of the H. from the 2cm: 
myxlSheet11.PageSetup.RightMargin := 2 / 0.035 ;
I. pages horizontally: 
myxlSheet11.PageSetup.CenterHorizontally := 2 / 0.035 ;
The J. page vertically: 
myxlSheet11.PageSetup.CenterVertically := 2 / 0.035 ;
K. print cell line: 
myxlSheet11.PageSetup.PrintGridLines := True ;
23. Auto Fill of Range. Fills value 1-10 in p1:p10
    myxlSheet11.Range['p1', 'p1'].Value := 1;
    myxlSheet11.Range['p2', 'p2'].Value := 2;
    myxlSheet11.Range['p1', 'p1'].AutoFill(myxlSheet11.Range['p1', 'p10'], xlFillSeries);
Other fill options
  xlFillCopy 
  xlFillDays 
  xlFillDefault 
  xlFillFormats 
  xlFillMonths 
  xlFillSeries 
  xlFillValues 
  xlFillWeekdays 
  xlFillYears 
  xlGrowthTrend 
  xlLinearTrend 
  
24. Change Border style of cells in a range
    myxlSheet11.Range['p3', 'p4'].Borders.Color := clRed;
    myxlSheet11.Range['p3', 'p4'].Borders.LineStyle := xlDouble;
    myxlSheet11.Range['p3', 'p4'].Borders.Item[xlEdgeLeft].Color := clBlue;
    myxlSheet11.Range['p3', 'p4'].Borders.Item[xlEdgeRight].Color := clBlue;
    Other line styles.
xlContinuous 
xlDash 
xlDashDot 
xlDashDotDot 
xlDot 
xlDouble 
xlSlantDashDot 
xlLineStyleNone

25. Fill pattern style of cells in a range
    myxlSheet11.Range['p3', 'p4'].Interior.Pattern := xlPatternCrissCross;
    myxlSheet11.Range['p3', 'p4'].Interior.PatternColor := clBlue;
      Other pattern styles
xlPatternAutomatic
xlPatternChecker 
xlPatternCrissCross 
xlPatternDown 
xlPatternGray16 
xlPatternGray25
xlPatternGray50
xlPatternGray75 
xlPatternGray8 
xlPatternGrid
xlPatternHorizontal 
xlPatternLightDown 
xlPatternLightHorizontal 
xlPatternLightUp 
xlPatternLightVertical 
xlPatternNone 
xlPatternSemiGray75 
xlPatternSolid 
xlPatternUp 
xlPatternVertical

26. Add calculation function SUM/AVG/MAX/COUNT etc..
    myxlSheet11.Range['k1', 'k1'].Formula := '=Sum(p3:p8)';
    myxlSheet11.Range['k3', 'k3'].Formula := '=Avg(p3:p8)';
    myxlSheet11.Range['k5', 'k5'].Formula := '=Max(p3:p8)';
    myxlSheet11.Range['k7', 'k7'].Formula := '=Count(p3:p8)';

Comments

  1. I quickly had to show a friend how to do Excel "automation" in Delphi via type library / ActiveX and I haven't done it in 10+ years... so I found this tutorial and it worked very nicely for me (we got up to step 9 when my friend was finally convinced that this is a workable solution), thank you.

    *Some notes*

    With my version of Excel (Office 2010) I had to change something small:

    This: myxlApp.Range['A3','A3'].Value := 'value 2';
    had to change to: myxlApp.Range['A3','A3'].Value2 := 'value 2';

    You can also create the type library (Excel_TLB.pas) yourself in Delphi by going to "Component | Import component", specify "Import a type library" | Next | Select "Microsoft Excel 14.0 Object library" | Next | Next etc and include that in your project.

    Another small change: I used the "visual component" TExcelApplication which was created in the previous step: this makes object lifetime / memory management slightly easier.

    ReplyDelete
    Replies
    1. Ms Excel Automation In Delphi >>>>> Download Now

      >>>>> Download Full

      Ms Excel Automation In Delphi >>>>> Download LINK

      >>>>> Download Now

      Ms Excel Automation In Delphi >>>>> Download Full

      >>>>> Download LINK d3

      Delete
  2. Glad to hear that it helped you. And also thanks for the proposed changes you for office 2010 as it will help others lot.

    ReplyDelete
  3. Excelent Post, Thanks !!! Very usefull for me.

    ReplyDelete
  4. I have been trying to read from Excel and used this information as the basis for a test program.

    I get an exception class $C00000005 error with access violation at Oxoo62fd0b: read of address 0x000001bc when I use Workbooks.Open. Has anyone else had this and been able to solve it?

    The crash occurs in Excel_TLB.pas, which I imported as Donald Klopper suggested.

    The crash is at function TExcelApplication.GetDefaultInterface: _Application, at the first line:

    if FIntf = nil then

    The code that I have written as the test is:

    unit ExcelTest;

    interface

    uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Excel2010, Vcl.StdCtrls, Vcl.Grids;

    type
    TForm1 = class(TForm)
    OpenExcelFile: TButton;
    Button2: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Button3: TButton;
    Button4: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Column: TLabel;
    Label5: TLabel;
    FileOpenDialog1: TFileOpenDialog;
    procedure FormCreate(Sender: TObject);
    procedure OpenExcelFileClick(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    private
    LCID : Cardinal;
    myxlApp : TExcelApplication;
    myxlBook : TExcelWorkbook;
    myxlSheet11 : TExcelWorksheet;
    myxlSheet12 : TExcelWorksheet;

    public
    { Public declarations }
    end;

    var
    Form1 : TForm1;
    R : Integer;
    C : String;

    implementation

    {$R *.dfm}

    procedure TForm1.OpenExcelFileClick(Sender: TObject);

    var
    f : TextFile; // File handle
    SL : TStringList; // String list
    TS : string; // Temporary string
    OpenFileName : string;

    begin
    SL := TStringList.Create;
    with FileOpenDialog1.FileTypes.Add do
    begin
    DisplayName := 'Excel files (*.xlsx;*.xls)';
    FileMask := '*.xlsx;*.xls';
    end;
    with FileOpenDialog1.FileTypes.Add do
    begin
    DisplayName := 'Excel files (*.xls)';
    FileMask := '*.xls';
    end;
    FileOpenDialog1.Title := 'Select file to open';
    if FileOpenDialog1.Execute then
    begin
    AssignFile(f,FileOpenDialog1.FileName);
    OpenFileName := FileOpenDialog1.FileName;

    { "EmptyParam" is declared in Unit system and can be used when you don't want to
    specify a parameter}

    myxlApp.Workbooks.Open(OpenFileName,EmptyParam,EmptyParam,EmptyParam,EmptyParam,
    EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,
    EmptyParam,EmptyParam,EmptyParam,0);
    end;

    end;

    procedure TForm1.Button2Click(Sender: TObject);
    begin
    myxlApp.Disconnect;
    myxlApp.Quit;
    FreeAndNil(myxlApp);
    end;

    procedure TForm1.Button3Click(Sender: TObject);
    begin
    Label3.Caption := myxlApp.Cells.Item[R,C];
    end;

    procedure TForm1.Button4Click(Sender: TObject);
    begin
    Close;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    begin
    LCID := GetUserDefaultLCID;
    end;

    end.

    ReplyDelete
  5. Forgot to mention that I am using Delphi 10.3.3 and Excel 2016.

    Any pointers would be appreciated.

    ReplyDelete
  6. very nice and provide me informative content thanks for sharing for more information about how to Create new Workbook

    ReplyDelete

  7. Your blog is very nice and provide me informative content thanks for sharing for more information about Copy Worksheet

    ReplyDelete
  8. I put this very usefull Web page in my favorite, it is kicker to find at any time...

    ReplyDelete

  9. Hi Jitendra.

    I'm sorry for my bad English, but I wanted to THANK YOU VERY MUCH for the excellent post.
    Finally I found what to do, and how doing it, to manage data in Excel by Delphi.
    Thanks to Donald Klopper too for "Value2" way in Office 2010: I would hardly have come up with this solution myself!

    Hope some "Delphi brother" :) can find useful my trouble experience, and its solution, trying to connect to an Excel Application using Connect method (in blog post: myxlApp.Connect)

    TROUBLE
    I use several Delphi versions on my 64 bit Windows 10, where I installed a 64 bit MS-Office version, and tried to connect to Excel following the blog-post instructions, but Delphi raised the following errors

    - Old Delphi versions (i.e. Delphi 7) error
    "Project ExcelTest.exe raised exception class EOleSysError with message 'Esecuzione del server non riuscito'.

    - Recent Delphi versions (i.e. Delphi 10.1 Berlin) errors (two errors, in cascade)
    Error #1: "Esecuzione del server non riuscito, ClassID: {00024500-0000-0000-C000-000000000046}."
    Error #2: "Access violation at address 006695C6 in module 'ExcelTest.exe'. Read of address 00000000."

    SOLUTION
    I couldn't understand where the mistake was.
    Looking for "EOleSysError" online, I found that one of the possible causes is access to a 64 bit server (my Excel) with a 32 bit module (my Delphi application).

    So I tried to change the Delphi target, from WIN32 to WIN64, in Berlin version of the project and recompiled it, without changing anything and ... it worked perfectly! :)
    Unfortunately I will not be able to apply the same solution with Delphi 7 because it does not have a 64-bit target, but I am happy to have solved the problem.

    Thanks again for explaining the Excel approach with Delphi in a simple way and for the really good Delphi blog.

    I have subscribed to your newsletter.

    Bye, Sandro

    ReplyDelete
  10. @Sandro that's why I posted my ideas in the comments as well. You've now touched on a touchy subject in respect of "bitness". If the OS is 64 bit (which it usually is these days) then MS Office could be 32 bit or 64 bit (it's often still 32 bit) and Delphi apps could be either as well and if your Delphi app's bitness doesn't match that of Office your automation might fail. Even worse, your users could be using Office 365 "online only" which means that the API's aren't available through COM on the machine at all. A good idea would be to doing a number of bitness tests in your 64-bit "main app" (to evaluate whether you should execute your 32 bit or 64 bit COM utility) and then to ship both 32 and 64 bit utilities with your application to clients, always.

    Remember if you're stuck with Delphi 7 only, and your app / business doesn't generate a lot of money, you can use the latest Delphi 10 community edition. Please adhere to the rules regarding use of that version.

    Using Delphi 10 would allow you to target the various bitness platforms.

    You could most likely using Lazarus to target 32 bit and 64 bit in the same way, but I've never done COM level stuff with Lazarus, just "normal" client-dataset type DB apps and reports and such.You might be able to get more info here: https://wiki.freepascal.org/Office_Automation

    ReplyDelete
    Replies
    1. Thanks Donald for your suggestions, preventive bitness testing is a very good solution!

      In fact I wouldn't know how to manage my app on machines with online versions of MS-Office but, not having managed it to date even with "physical" versions for the moment my concern is premature :)

      With regard Delphi 10 versions, I have an active Delphi Professional subscription, and I own all the versions released to date, but I have never installed nothing after 10.1 (Berlin): from Berlin experience I was expecting at least update 2, but then they announced the 3 and ... for my laziness :) I've not yet installed last two versions 10.2 (Tokyo) and 10.3 (Rio). I'm now waiting for the official release of 10.4 (don't know the name), which is already active in Beta, and will install that.

      I'm using Delphi 7 for some old projects that, in spite of myself (swear!), I still can't migrate to new horizons (it's a long story, but it's definitely off-topic compared to this thread and Jitendra, to whom I send my greetings, could throw us out !) :)

      Thanks again for everything.

      Bye, Sandro

      Delete

  11. Amazon SAP-C01 Dumps are offering the most outrageous accommodating stuff among the aggregate of the materials. It has helped various individuals to evade their evaluations at some point or another on the planet. Your all endeavors without SAP-C01 study material have been incapable so I picked it and aced the test. You will choose it for the sum of the resulting examinations due to the truth it’s much absolutely cheerful for all. To make it basic our gathering of competent teachers from wherever the world has amassed an exceptional report material to pass IT affirmations. The assessment control is outstanding it very well may be said that it contains a fundamental and vast range of questions and answers. Just to guarantee the quality, a freed from cost demo variation is similarly open. We moreover help you with defeating your AWS Certified Professional exam by an unequivocal guarantee methodology. To be more prepared you can moreover benefit from an online test engine for preparing tests. Dumpsprofessor.com worked unquestionably with the guide of using following the total of the recommendations from specialists.

    ReplyDelete
  12. I would not be able to pass my IT exam with so good grades without the use of Microsoft Exam dumps. It was only through this PDF file that I got the real concept of each topic and competently gained a good amount of knowledge of the field. There is no match for Microsoft dumps.

    ReplyDelete
  13. Have you ever considered about adding a little bit more than just your articles? I mean, what you say is valuable and all. Nevertheless think about if you added some great photos or videos to give your posts more, "pop"! Your content is excellent but with pics and video clips, this site could undeniably be one of the most beneficial in its field. Awesome blog!
    web developer berlin

    ReplyDelete
  14. I have a question. I'm currently doing a project which requires the creation of many sheets withing a workbook. Each sheet requires starting with a template. How can I load the template in to a newly added sheet before I start to load the data?

    ReplyDelete
    Replies
    1. Hi Robert

      Why does your name sound so familiar?

      It looks like the solution entails creating a new workbook from the template, and then copying the contents from the resulting sheet to another nominated / new sheet in another workbook. A little clunky, but seems to work.

      The way I get decent search results on Excel type-library stuff is to search for "excel new sheet from template vba" or something similar. It's usually trivial to convert the VBA into Delphi code.

      This page seems to solve the problem:
      https://www.ozgrid.com/forum/index.php?thread/149088-macro-to-create-a-new-sheet-from-a-template-and-name-it-based-on-prompt/

      This page discusses the same topic but doesn't seem to get to a solution as quickly:
      https://www.mrexcel.com/board/threads/vba-code-to-create-a-new-sheet-from-a-template-and-rename-it-from-a-list.813294/

      Delete
    2. Donald, I certainly appreciate your quick reply, and I will look into the info you supplied. However, I was wondering if you know whether there are any functions within Excel2000 that do this, or where I could find complete documentation online for the same?

      Thanks again,

      Bob

      Delete
    3. Hi Bob

      I hear you.

      I don't know what your Delphi / VBA proficiency is, so please forgive me if this is too simple.

      As mentioned, the VBA (Visual Basic for Applications) documentation is your best friend, or any sites that focus on VBA. VBA is the language that MS Office records / runs its macros in, and is quite simple to understand / write.

      If you can do something in Excel by using the menus or shortcut keys, you can record it as a macro. Then you can inspect the macro. So if it were possible (which it doesn't seem to be) to create a new sheet from a template by using manual actions in Excel, you could just record those actions to a macro and look at the resulting code, and then duplicate the effort in Delphi (it'll be VERY similar but not the same).

      The Delphi .PAS file (Excel_TLB.pas) is the Excel ActiveX export for all of the Excel functions accessible programmatically. In my version it's 57000 lines. This isn't actual code, it's just interfaces to possible functionality to "remote control" Excel. In a sense it's self-documenting, since it's all there.

      If you knew everything that I've just explained, then my explanation was too simple for you, but someone else might still benefit.

      So I don't think you need complete documentation except for the VBA manuals that are available on the web for, MS Office, linked through F1 clicks in the VBA code.

      For example, getting F1 help on the Sheet1.Copy function in VBA in Excel navigates to this web page: https://docs.microsoft.com/en-us/office/vba/api/excel.worksheet.copy?f1url=%3FappId%3DDev11IDEF1%26l%3Den-US%26k%3Dk(vbaxl10.chm174074);k(TargetFrameworkMoniker-Office.Version%3Dv16)%26rd%3Dtrue

      There's another idea around the pattern to create new sheets based on templates... create an "unused" sheet that you open from a template initially, and never use it ... then when you need to create a new sheet based on the template, you just copy that sheet again. So it's the same technique that I mentioned initially, just a little but less clunky.

      I await your feedback :-D

      Delete
    4. Donald,

      Thank you so much for taking the time to help me. Your last line is the one that interests me. I have the template created and what I want to do is to load it into a sheet created via Excel2000 (examples 5 and/or 7 above), but I can't seem to find any method that does this. Is it possible?

      Bob

      Delete
  15. I have successfully attempted for Microsoft Office Specialist: Microsoft Excel Expert (Excel and Excel 2019) | Microsoft Office Specialist and it only because of MO-201. I was not having much time to prepare but I was able to cover my whole syllabus only with the help of this dumps material. I say thanks to this material for being so concise and to-the-point in answering the questions. I easily memorized MO-201 which is comprehensive and gives a full understanding of the field.

    For More Info Visit: https://www.dumpspool.com/microsoft/mo-201-dumps.html

    ReplyDelete
  16. Thank you so much for providing these accurate Microsoft MO-201 exam dumps. I'm feeling very happy.

    ReplyDelete
  17. Great work. Are there any similar example for MS-Word and MS-Powerpoint

    ReplyDelete
  18. Ms Excel Automation In Delphi >>>>> Download Now

    >>>>> Download Full

    Ms Excel Automation In Delphi >>>>> Download LINK

    >>>>> Download Now

    Ms Excel Automation In Delphi >>>>> Download Full

    >>>>> Download LINK RV

    ReplyDelete
  19. MS Excel Automation in Delphi is a very new idea.
    We support this digital effort.
    Anyways guys we are.
    Digital Marketing Training in Pathanamthitta.
    Visit Us


    ReplyDelete
  20. If the excel file is located in a cloud this doenst works!! do you know why?

    ReplyDelete

  21. Informative post indeed, I’ve being in and out reading posts regularly and I see alot of engaging people sharing things and majority of the shared information is very valuable and so, here’s my fine read. reactjs training in pune

    ReplyDelete
  22. Thanks For Your Blog. Are you looking for the best Excel Automation Services to automate your repetitive tasks? Check Automate Excel Reports Here

    ReplyDelete
  23. Hi Neeraj.
    Finally a post consistent with the article in question! :)
    Enough advertising posts, I can't take it anymore!

    ReplyDelete
  24. Nice blog article that I have read today. Keep uploading these types of Articles regulerly. Also, refer Data Science Course in Kolhapur

    ReplyDelete
  25. Useful post Thanks for sharing it that truly valuable knowledge about similar topic. python training in satara

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. Thanks for a fantastic article.

    I have a question regarding Summing a range of cells
    Your example: myxlSheet11.Range['k1', 'k1'].Formula := '=Sum(p3:p8)';

    However I only want to SUM the range and store the value of the Sum in a variable at runtime without entering a formula somewhere in the spreadsheet.

    Something like

    MyVariable := myxlSheet11.Range['A1', 'A1'].Sum

    I know this is wrong but hoping someone can help. I am not getting any joy from Google.

    I know I can iterate the Columns but want a quicker way to do this.

    ReplyDelete

Post a Comment

Popular posts from this blog

ShellExecute in Delphi

Drawing Shapes in Delphi