How to correctly connect .xlsx to PascalABC.NET?

Now write a prog on PascalABC.NET using WindowsForms.
In short,it is a search engine that connects to the Excel file (.xlsx) and looking for there input before that user.
procedure Form1.button1_Click(sender: Object; e: EventArgs);
var 
f:TextFile;
s,str:string; 

begin
assign(f,'D:\Дані.xlsx');
reset(f);

 s:= textBox1.Text;

 while not eof(f) do
begin
phony(f,str);
 if pos(s,str)>0 then
 textBox2.Text:= textBox2.Text + str+#13#10;

end;

end;

The program connects to the file as intended,but perhaps can not find what you need in this Excel file.The algorithm works,so works on normal .txt.Has anyone encountered such? On one of the forums I read that with this type of files should be treated the same way as usual .txt.

4978c7ace5924e72a57e2decb429db04.PNG55862de34e844a858a49e6af465a5f21.jpg
July 2nd 19 at 13:18
1 answer
July 2nd 19 at 13:20
You initialize a variable of type TextFile value of the file .xlsx. It's a bit strange, anyway...

Specifically, I worked in two ways with the Excel files:
-By creating a Com object in Excel. Read, if you do not know.
Through third-party libraries(of which for .NET enough).

And I suggest this trick: rename the file.xslx in file.zip. Open the archive and you will see that the structure of the document described by the xml file. You can try this way to dig - that is, to understand the structure of the file and create/read new seen pattern matching using xml.

Read more about MS Office XML formats: Link
To Excel in file.txt and so I can work with the text,but the user will have to do extra steps each time saving the updated data first in Excel,then export and overwrite the file.txt.I'm committed to minimising the steps a user. - Doug.Wiega commented on July 2nd 19 at 13:23
the only way to transfer such files .txt to use .csv format. He is converted to text, and I think you'll have to read it as text. The thing is that inside the file .xslx is a certain hierarchy separate xml files. And reading all this mess as the text you get at the output is nothing. - Lera.Durgan8 commented on July 2nd 19 at 13:26

Find more questions by tags Windows.NETPascalExcel