Advertisement

01.13.2004 at 12:53AM PST, ID: 20849222
[x]
Attachment Details

delphi + excel

Asked by h_mann in Delphi Programming

Tags: delphi, excel

Hey there,

i need to work with MS Excel within delphi!

i've found out how to open excel, open a new workbook/worksheet
i can also add data to the workbook and in other ways manipulate the cells etc.

something like:

var
  OleApplication : Variant;
begin
   OleApplication := CreateOleObject('Excel.Application');
   OleWorkBook   := OleApplication.Workbooks.open('c:\temp\excel.xls');
   ..
   ..
   ..
end;


what i need is to be able to open a comma seperated file (.csv)!
not as a new workbook/worksheet, but open it into an existing (already open) workbook..

eg. i have a file with some headers/headlines in row 1. then i want to get the data from another file (the .csv file) into the same woorkbook!

if i open the .csv with the "open" procedure it will open as a new workbook/sheet..
i need to do the same as you do, when you in Excel choose "import data from textfile"..

i've seen somthing about a .opentext procedure which takes a lot of parameters, but i cant get it working..

anyone ?

/HMann








Start Free Trial
[+][-]01.13.2004 at 09:08AM PST, ID: 10105737

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Delphi Programming
Tags: delphi, excel
Sign Up Now!
Solution Provided By: rllibby
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.14.2004 at 09:13AM PST, ID: 10112508

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32