Skip to content
Raphael Stoeckli edited this page Sep 30, 2022 · 4 revisions

Q: Is NanoXLSX free?
A: Yes, it is absolutely free under the MIT license. You can use the library also for commercial applications. There is also no Pro-version. You get all the features for free.

Q: What is the purpose of the library?
A: The main purpose of NanoXLSX is to export data from your application to Excel files or to read basic data from an Excel file. Spreadsheet exports are often a requirement in many applications. But plain text or CSV cannot carry formatting, formulas or more than one worksheet. The library provides an easy data export. When it comes to imports, NanoXLSX provides an easy way of reading spreadsheet data from a Excel file without the necessity of converting the file to CSV or other text formats.

Q: Is there more documentation than the Wiki and the Readme?
A: Please see the full API-Documentation at: https://rabanti-github.github.io/NanoXLSX/ for more details. You may also find many hints in the unit test project.

Q: Why should anyone use this library? Excel over Interop is not that hard and other libraries are also out there.
A: This library was created to provide mainly an exporter and basic reader for portable programs. These programs should also work if there is no Excel installed or only an outdated version of Office (e.g., industrial terminals, test VMs, thin clients). In this case, Interop is unreliable or does not work at all. Other powerful libraries exist, yes. The benefits of NanoXLSX are the low requirements and the easy usage (see demo programs). Plus, it is possible to compile the library into your application if you use the source files. No additional DLLs/assemblies or 3rd party libraries are required to run NanoXLSX, except some extremely common dependencies. Although there are other libraries with a small footprint as well, NanoXLSX provides a big variety of functions like styling, worksheet protection, meta data , formula support or retrieval of existing XLSX files, and does not require the OOXML SDK.

Q: Why 'Nano'?
A: NanoXLSX is designed as very small library. There are also some limitations like the lack of diagrams or no support of macros. It is intended as a library as small and simple as possible.

Q: Does NanoXLSX need an installation of Excel or other libraries to create XLSX files?
A: No, only the following assemblies are necessary to compile the library by yourself: WindowsBase to write files and System.IO.Compression to read files are necessary in .NET4.5 (or higher), respectively System.IO.Compression for .NET Standard. Usually NuGet will resolve everything for you.

Q: Can NanoXLSX also read Excel files?
Excel A: Yes, in contrast to PicoXLSX has NanoXLSX the ability to read Excel files. However, this ability is limited to a certain scope. You can only read what you can write with NanoXLSX.

Q: Can NanoXLSX edit existing Excel files?
A: Not really. NanoXLSX is not an editor bat a writer/reader. Reading a file will discard all unknown data. If you overwrite an existing file after reading, you will certainly lose information (e.g. macros, diagrams or pivot tables)

Q: Can NanoXLSX also create charts or other elements like shapes or text fields?
A: No, only worksheets with cell values (spreadsheets), formatting and several other options are supported.

Q: Which data types are supported for the cells?
A: Strings (text), numeric types (integer, long, double, float, byte, sbyte, decimal, uint, ulong, short and ushort), boolean, DateTime, TimeSpan and formulas as strings. When Excel files are loaded, numeric values are represented as doubles, since an Excel file does not contain data about the actual numeric data type.

Q: Can cells be formatted, when writing Excel files?
A: Yes. Styling is supported and basic styles like bold text, cell borders, text alignment, number formats and background colors are easy to call (BasicStyles class). However, there is a big variety of style combinations. It may be rather complicated to define very specific styles, like custom fonts in combination with gridlines, background colors and text alignment. Appending style information (.Append(...)) can help to manage complex styles easier.

Q: Can cell formats be retrieved when reading Excel files?
A: Yes, everything you can write, can be read. However, there might be some deviations.

Q: Is it possible to read diagrams or encrypted Excel files with NanoXLSX?
A: No, the encryption and decryption of entire Excel files is not supported yet. Furthermore, other data than plain cell values and formulas are not supported.

Q: Are Unicode characters supported as cell value, when writing Excel files?
A: Yes, the library supports UTF-8 and was tested with Japanese, Chinese, Cyrilic, Arabic, Hebrew, Greek, Hindi and Korean characters, as well as diacritics from German and French. Reading of UTF-8 should be also no problem.

Q: Is it possible to create or read more than one worksheet in one workbook?
A: Yes, there is no limitation, except the memory of your system, respectively limitations by programs like Excel. Keep also in mind that there are other limitations of Excel, like a maximum row number of 1048576 and a maximum column number of 16384.

Q: Can NanoXLSX also be used with Mono or other platform specific .NET implementations?
A: Technically, this should work, since .NET Standard covers (currently) Mono 4.6, 5.4 and 6.4. Other implementations like Xamarin may also work, but are not tested yet.

Q: Is it possible to use the standard Excel formulas?
A: No, unfortunately another syntax is used in OOXML. For example, FLOOR is called ROUNDDOWN. The syntax can be looked up in the OOXML documentation or easier yet, when opening an Excel file with the desired formula as ZIP file or using a tool like Media-Extractor. Then you can look into the file \xl\worksheets\sheet1.xml (if you took the formula in the first worksheet).
$

Q: How are formulas retrieved when reading Excel files?
A: Formulas are retrieved as plain text. If, for instance, a formula points to the cell A1, the cell value of this formula will be simply a string “A1”. The leading equal sign is omitted.

Q: What is the easiest way to use NanoXLSX?
A: The easiest way is to use NuGet. Simply add NanoXLSX as dependency to your project.

Q: There is an error (unsupported) concerning the documentation project, when I clone the solution into an IDE. What is wrong?
A: You are missing the Sandcastle Help File Builder (SHFB). This Visual Studio package is needed to compile the documentation project of NanoXLSX. Install SHFB to get rid of this error or simply exclude the documentation project if you don't need a documentation project. Alternatively, you can compile the documentation with the SHFB standalone application.

Q: I try to open the Solution in Visual Studio. But I get only the message that the project was created with a newer version of the IDE. What can be done?
A: NanoXLSX was originally created with Visual Studio 2017 and is currently maintained on version 2019. If you use 2015 or an older version you can create a new solution in your IDE and copy just the .CS files from the NanoXLSX solution into the new project. As long as the .NET version is sufficient to compile NanoXLSX, your newly created solution should work.

Q: When I include the classes of NanoXLSX into my project, many errors are emerging. The reference System.IO.Packaging also seems not to be valid. What is wrong?
A: You are missing the assembly WindowsBase and/or System.IO.Compression. Please look at the requirements to include this assembly.

Q: I included NanoXLSX.dll into my solution added a reference in the IDE but get the error "The type or namespace name 'NanoXLSX' could not be found (are you missing a using directive or an assembly reference?)" when I try to compile the solution. What is wrong?
A: The .NET version of your solution does not match with the version of the DLL. Try to change the version of your solution to the version of the DLL (currently v4.5). If you cannot change the version, try to use the source files of NanoXLSX instead, respectively try to compile the library in your default .NET version.

Q: I cannot find the necessary WindowsBase.dll or System.IO.Compression.dll. There are no such files on my systems.
A: You have probably not installed Microsoft Visual Studio. Then you can use the Global Assembly Cache (GAC) of Windows. If your IDE supports selecting from the GAC, search there for the WindowsBase or System.IO.Compression assembly. Otherwise look into the folder "c:\Windows\Microsoft.NET\assembly\GAC_MSIL\WindowsBase" and “c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.IO.Compression”. There should be a sub-folders with the matching assemblies as DLLs.
However, have a look into the .NET Standard version. It will make your life much easier than setting up rather exotic .NET4.x environments

Clone this wiki locally