Solved

Create an Excel file ??

Posted on 2001-08-22
4
356 Views
Last Modified: 2010-04-06

How can I create an Excel file using the "servers" component with Delphi 6 ?

This code do not work:

  ExcelApplication1.Connect ;
  Try
    ExcelApplication1.Workbooks.Open('C:\Test.xls',
      EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
      EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
      EmptyParam, EmptyParam, 0) ;
    ExcelWorkSheet1.ConnectTo(ExcelApplication1.Sheets[1] As _WorkSheet) ;
  Except
    ShowMessage('Oupss !') ;
  End ;

0
Comment
Question by:frdep
  • 2
4 Comments
 
LVL 2

Accepted Solution

by:
RickHalle earned 50 total points
ID: 6415788
Try this:

  ExcelApplication1.Connect;

  ExcelApplication1.Connect;
  try
    ExcelApplication1.Workbooks.Open('C:\Book1.xls',
      EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
      EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
      EmptyParam, EmptyParam, 0);
    ExcelApplication1.Visible[0] := true;
//   ExcelWorkSheet1.ConnectTo(ExcelApplication1.Sheets[1] As _WorkSheet) ;
  except
    ShowMessage('Oupss !');
  end;

What you had appears to make the connection but there is no feedback to let you know this.

Rick Halle
0
 
LVL 2

Expert Comment

by:RickHalle
ID: 6419919
Was that what you were looking for?
0
 
LVL 2

Expert Comment

by:florisb
ID: 6432080
Hi,

If you search in the PAQ, you will find some example code of me, that creates an excell file and fills it with items.

Cu,
Floris.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9287993
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept RickHalle's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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