Excel lesen

Deutschsprachiges X#-Forum – German language forum

Moderator: wriedmann

User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Excel lesen

Post by Horst »

Hallo Robert
i changed the names just to test it, but i cant use the dot, btw : its ok , i have only to remember when i am converting c# to x#

I saw the excel.dll is very small so i wanna rewrite it to x# , (with help of IlSpy)
i saw lines like :[XmlElement("c")];
This are comments , right ?
Horst
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Excel lesen

Post by Horst »

Hallo
Ich habe nun die Excel.dll auf x# umgeschrieben.
Eine Fehlermeldung kriege ich nicht weg.
BEGIN USING oZipArchive := ZipFile.Open(cExcelFileName, ZipArchiveMode.Read) bei dieser Zeile kennt er ZipFile nicht.
Ich habe das Using drin und 2 dll's system.io.compression und system.io.compression,zipfile.
Stehe am Berg. Im Anhang das Viaef File wen einer so gütig wäre mich zu erleuchten ;-)
Gruss
Horst
Attachments

[The extension viaef has been deactivated and can no longer be displayed.]

User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Excel lesen

Post by wriedmann »

Hallo Horst,
ich nehme an, Du brauchst die DLLs System.IO.Compression und System.IO.Compression.FileSystem.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Excel lesen

Post by Horst »

Hallo Wolfgang
Die habe ich angegeben, bei den Referenzen aus dem GAC ausgesucht. , siehe Screenshot

error XS0103: The name 'ZipFile' does not exist in the current context 17,3 Workbook.prg Workbook:Worksheets
Rebuild failed

Gruss
Horst
Attachments
Referenzen.jpg
Referenzen.jpg (95.9 KiB) Viewed 206 times
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Excel lesen

Post by Horst »

Ahhhhh

System.IO.Compression.FileSystem.
Danke
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Excel lesen

Post by wriedmann »

Hallo Horst,
nicht System.IO.Compression.ZipFile, sondern System.IO.Compression.FileSystem.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1532
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Excel lesen

Post by FFF »

BEGIN USING oZipArchive := System.io.Compression.ZipFile.Open(cExcelFileName, ZipArchiveMode.Read)
und, wie Wolfgang schrieb, die System.IO.Compression.FileSystem.referenzieren.
EDIT, nachdem ich mein Doppelpost nicht löschen kann, damit es zu was gut ist: Läuft das bei Euch?
Ich sehe:
System.InvalidOperationException
Fehler im XML-Dokument (2,2).
Callstack :
static Object Workbook.DeserializedZipEntry(System.IO.Compression.ZipArchiveEntry ZipArchiveEntry)() : C:DevXIDEProjectsExcelApplicationsExcel_HorstPrgWorkbook.prg : 48

Und wenn ich mich per Debugger vorarbeite, kommen vorher noch eine ganze Menge "handled execptions" mit out of range usw.
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Excel lesen

Post by Horst »

Hallo Wolfgang

Aber wo hast du das jetzt nachgeschaut ? Auf https://docs.microsoft.com/en-us/dotnet ... ew=net-5.0 wird nur System.IO.Compression.FileSystem. angegeben,

Horst
User avatar
Horst
Posts: 327
Joined: Tue Oct 13, 2015 3:27 pm

Excel lesen

Post by Horst »

Ich habe gerade einen Lachanfall

Habe den Link angeklickt und nun steht in GRÜN , dass man die filesytsem einfügen muss.
Blind.

Horst
User avatar
wriedmann
Posts: 3655
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Excel lesen

Post by wriedmann »

Hallo Horst,
das habe ich selber mal vor einem Jahr oder so gebraucht.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply