Not possible without heavy customization I'm afraid.
The .NET component provided by MS completely disregards content/formatting of the written cell, and writes default values. A modification is required which would read the cell and formatting before writing the cell, and use the same attributes in a call to write operation.
But even this is very limited as the wrapper MS provided with NAV hides a lot of properties, so they cannot be read.
You may need to restore to some 3rd party components, like ClosedXML, which wraps many tedious OpenXML calls into nice functions. Still, a considerable amount of work is required to make it working and foolproof.
Comments
The .NET component provided by MS completely disregards content/formatting of the written cell, and writes default values. A modification is required which would read the cell and formatting before writing the cell, and use the same attributes in a call to write operation.
But even this is very limited as the wrapper MS provided with NAV hides a lot of properties, so they cannot be read.
You may need to restore to some 3rd party components, like ClosedXML, which wraps many tedious OpenXML calls into nice functions. Still, a considerable amount of work is required to make it working and foolproof.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03