misc_bb 7 Posted May 23, 2022 I know a lot of you might have worked with reading and writing Excel sheets with Delphi. I would like to ask if its possible to read an excel file without opening it? Share this post Link to post
Wagner Landgraf 43 Posted May 23, 2022 (edited) Yes: https://doc.tmssoftware.com/flexcel/vcl/guides/api-developer-guide.html#reading-and-writing-files Edited May 23, 2022 by Wagner Landgraf Share this post Link to post
misc_bb 7 Posted May 24, 2022 I think I've read this article as well. Not interested in buying yet but we'll see. Thank you. Share this post Link to post
corneliusdavid 214 Posted May 24, 2022 6 hours ago, misc_bb said: read an excel file without opening it? Uh, how do you expect to get the contents of a file without opening it? Or do you mean that you don't want to use OLE? I've used XLSReadWrite successfully. 4 Share this post Link to post
David Heffernan 2345 Posted May 24, 2022 7 hours ago, misc_bb said: I would like to ask if its possible to read an excel file without opening it? No. It is not possible to read an excel file without opening it. However, I suspect that what you actually want to do is to read such a file without using an Excel process via its COM API. If that is what you want to do then it is indeed possible. 1 Share this post Link to post
Dave Nottage 557 Posted May 24, 2022 7 hours ago, misc_bb said: I would like to ask if its possible to read an excel file without opening it? Without using OLE? Yes. An .xlsx file is in .zip format. You can extract the contents using TZipFile and read the (mostly) xml files inside. You could learn the spec and parse the xml. Here's some links that might help: https://docs.fileformat.com/spreadsheet/xlsx/ http://officeopenxml.com/anatomyofOOXML-xlsx.php https://www.brendanlong.com/the-minimum-viable-xlsx-reader.html https://c-rex.net/projects/samples/ooxml/e1/Whitepaper/spreadsheetml.html Share this post Link to post
Angus Robertson 574 Posted May 24, 2022 I've been using Axolot Data XLSReadWrite to read and create XLS and XLSX spreadsheets for almost 20 years. Not free, but just works. http://www.axolot.com/ Angus 1 Share this post Link to post
Der schöne Günther 316 Posted May 24, 2022 A year or two ago, I used NPOI (.NET) for exporting to an excel sheet with formulas and different formats. It was a breeze NuGet Gallery | NPOI 2.5.6 nissl-lab/npoi: a .NET library that can read/write Office formats without Microsoft Office installed. No COM+, no interop. (github.com) Free, widely used, but not in Delphi. You'd have to go with .NET and include that in your Delphi app. Share this post Link to post
Alexander Sviridenkov 356 Posted May 24, 2022 HTML Office Library can read (and display) all office formats (XLS, XLSX, XLSB, DOC, DOCX, PPT, PPTX) and also PDF, EPUB, FB2, HTML, MD (markdown), EML, MSG (Outlook), WMF, EMF. All platforms, only plain Delphi code. Share this post Link to post
misc_bb 7 Posted May 24, 2022 @corneliusdavid Thank you. I think I'll go for this library. @Dave Nottage I'm currently using OLE but wanted to avoid Excel app from opening. Thank you for the suggestion but I've been thru a lot with OOXML working with docx files, I don't want to go there for the mean time. Share this post Link to post
softtouch 9 Posted June 4, 2022 I use on Windows / Firemonkey / OSX OExport from http://www.kluug.net. Its not free, but just works for years for me. Share this post Link to post
Hans J. Ellingsgaard 21 Posted June 5, 2022 You can load Excel sheets into a FDMemTable via Microsoft's odbc drivers. 1 Share this post Link to post