Append a .0 to numbers in the range [1900,9999] if returning XML data to Excel. #116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a bug in Microsoft Excel 2013's FILTERXML function, which causes
it to attempt to coerce numbers between [1900,9999] as dates. It then
returns their serial value (number of days since Jan 1st, 1900). This
coersion happens at a point where the user is unable to prevent it and
there is no known work around.
Luckily, when Excel 2013 requests data using its WEBSERVICE function, it
sets its user agent to Excel/15.0. We can thus check if Excel is downloading
data and if so, append a .0 to the end of numbers within that range. This
will prevent date coersion, and doesn't negatively impact the data, since
in Excel all numbers are floating points when doing calculations anyway.