Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to create excel file by delphi

Posted on 2001-07-14
5
Medium Priority
?
344 Views
Last Modified: 2011-09-20
hi ihave aproblem with the servers component in delphi the procedure below should open excel97 but it doesn't do
so,i'm running excel2000.  
{ No need to start Excel ourselves, since the ExcelApplication's AutoConnect
    property is True }
  lcid := GetUserDefaultLCID;
  ExcelApplication1.Visible[lcid]:=True;

  { Create a new workbook }
  { The TOleEnum cast in the next line just prevents compiler range warnings }
  WkBk.ConnectTo(ExcelApplication1.Workbooks.Add(TOleEnum(xlWBATWorksheet), lcid));
  WS.ConnectTo(WkBk.Worksheets[1] as _Worksheet);
  WS.Name := 'Data';
  EnterData;
end;
the error message is(old format or invalid type library)
0
Comment
Question by:hussamd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6283088
Hello

Look at this page, it will help you alot to connect excel from delphi

http://www.djpate.freeserve.co.uk/AutoExcl.htm

Best regards
Mohammed
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6284398
You can also do it without Excel:

http://www.wotsit.org/download.asp?f=xls
0
 
LVL 21

Expert Comment

by:ziolko
ID: 6284696
Try this:
LCID:=LOCALE_USER_DEFAULT
FExcelApplication.ConnectKind:=ckNewInstance;
FExcelApplication.Connect;
FExcelWorkbook.ConnectTo(FExcelApplication.Workbooks.Add(TOleEnum(xlWBATWorksheet),LCID));
FExcelWorksheet.ConnectTo(FExcelWorkbook.Worksheets[1] as _Worksheet)
.
.
.
FExcelWorksheet.Name:='name';
.
.
FExcelApplication.Visible[LCID]:=True/False;
FExcelApplication.ScreenUpdateing[LCID]:=True/False;
FExcelApplication.displayAlerts[LCID]:=True/False;
where FExcelApplication is instance of TExcelApplication
and FExcelWorkbook is instance of TExcelWorkbook
and FExcelWorksheet is instance of TExcelWorksheet
ziolko.
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8703121
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:

To be PAQ/Refund

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Thank you,
Russell

EE Cleanup Volunteer
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 8822155
PAQ'ed and points not refunded

PashaMod
CS Moderator @Experts Exchange
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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