R
R
Ruslan2014-12-11 09:38:44
Delphi
Ruslan, 2014-12-11 09:38:44

How to work with Excel documents in Delphi?

Hello.
The task was to convert 1 Excel document into several others.
There is one large Excel table with several hundred products, which are divided into product types, and each type has several dozen intratype characteristics. Based on this large table, it is necessary to create a price list on several pages, divided into characteristics, etc., and into separate 4 files for uploading to several highly specialized sites.
It was decided to solve this programmatically in Delphi, but did not work on Excel documents in it. We need adequate manuals without the need for a long study - you need to do everything in a week. Help, please, with materials and advice, links.
For smart guys - I'm a terrible coder and I feel more or less comfortable in it, sorry.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mercury13, 2014-12-12
@Mercury13

There are two options, OLE automation and direct XLS file support.
I'm crazy and according to the specifications of Micro$oft I wrote the second one (after all, in a commercial program, from which, however, no design refinements are required, it's better).
For a one-time utility, the first is better. You can also work through CSV.

L
ldv, 2014-12-11
@ldvldv

www.webdelphi.ru/2009/08/rabota-s-excel-v-delphi-o...

S
SHVV, 2014-12-11
@SHVV

Through automation. Here, for example, the first link from Google: Delphi + Excel .
In general, Excel Automation can be manipulated with scripts (JScript, VBScriopt).

N
Nashev, 2015-02-12
@Nashev

You no longer need it, but let the answer be here for the readers:
If you write through OLE Automation, then all work with Excel itself will turn out exactly the same as on the Visual Basic for Application built into it, on which he himself offers to write his macros, only aggravated to features of data types in Delphi. Moreover, in order to debug this part, the easiest way is to first write it in VBA itself exactly as a macro, debug it, and only then transfer it to Delphi, changing only the syntax details.
The main thing I want to say is that if nothing is needed within this code that VBA could not do, then most likely there is no point in transferring this macro to Delphi. VBA macros can do a lot.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question