Solved

Create an Excel file ??

Posted on 2001-08-22
4
360 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

14 Experts available now in Live!

Get 1:1 Help Now