35 Replies
$excel
ClosedXML 0.102.1
See release notes https://github.com/ClosedXML/ClosedXML/releases/tag/0.102.1 ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.
i can't use that
ok
without information i can't give a good suggestion
i can't have references
in my project
why?
because basically any excel editing/interop is going to be a library you need to reference
you are talking about .xlsx files, right? not csv/tsv/some other plaintext format?
yes xlsx
so you need to reference a library unless you plan on implementing your own XLSX manipulation library (which is a terrible idea)
i only really need to read contents
you still need code that understands the file format
so your options are to write it or use someone else's
what is the reason you can't have references?
the program i'm using doesn't support it
aren't you writing the program?
please provide enough detail in your question that we can help you
need to read a excel file
- but can't use references / libary
you're kinda out of luck then
ClosedXML is MIT open source. If you "can't have references" then you can copy all the source code into your project. But, that would also be idiotic if you can use it a nuget package reference instead.
i feel like "can't have references" suggests there is a lot more context that isn't being shared
Indeed. Or the questioner is trying to obscure something in their work.
well, until that context is given there's nothing else we can suggest
Anyway... the answer to "how to read an .xlsx" is fully "described" by any number of open source libraries: ClosedXml, ExcelDataReader, NPOI, MiniExcel, FastExcel, Sylvan.Data.Excel (the one I wrote), or one of many others.
How easy they are to use is up to you to decide, but I've measured the performance of most of them: https://github.com/MarkPflug/Benchmarks/blob/main/docs/ExcelReaderBenchmarks.md#excel-xlsx-benchmarks
GitHub
Benchmarks/docs/ExcelReaderBenchmarks.md at main · MarkPflug/Benchm...
Benchmarks for various .NET libraries. Contribute to MarkPflug/Benchmarks development by creating an account on GitHub.
what more context?
i've asked several times
why can't you use libraries?
the application i'm using doesn't support it
you already said that
what application? how does your code interact with it?
hmm wait so
i can't install anything into my project
but why?
i'm trying to help you find solutions here, make it easy for me
yes sorry
these are the only options for my project :(
what application is this?
company's
your company has a custom in-house IDE?
yes
i guess you're out of luck then
your best option would be to copy and paste the source code from a library that permits that kind of usage like MarkPflug suggested
or ask someone at your company for help
Have u added the assembly?
Can u send the using part with the error
read above, he's using some special editor his company made that doesn't allow project/assembly references