MS Access export to Excel breaks the Excel file when the decimal and thousand separator have been swapped

0

I changed a setting in a GPO to swap the decimal symbol to the comma and thousand separator to a full stop:

enter image description here

This is so when some old MS Access app generates Excel and Word reports, the numbers are formatted correctly for our European users. After making the swap, I ran a report from Access with 1 column that had no data in it. When I opened the Excel document, I got an error stating that the data was corrupted:

enter image description here

Upon clicking yes, the document opens. However when it's a full blown report, that "fix" breaks charts and macros. It seemed odd to me that a doc with no data could be corrupted. So I looked at the XML of the sheet and found that it was setting the size of something to a value that Excel couldn't handle. Excel was expecting a full stop for a decimal instead of a comma.

enter image description here

I even checked Excel and it said it was using the system settings. So I changed them to explicitly use the comma:

enter image description here

Still no luck. When I change the 15,125 to 15.125, Excel works, despite all of the regional changes I have made. Any ideas what's going on here?

ernest

Posted 2019-02-13T17:19:49.533

Reputation: 51

Answers

0

The problem was that Access pulls the decimal symbol based on your format region, even if you override it. When it was writing the XML data, it pulled the comma instead of the period. And Excel's XML doesn't know how to handle the comma, regardless of your settings.

When I changed the format to a country that supports the comma as a decimal symbol, Access was able to write the XML with a full stop.

enter image description here

enter image description here

ernest

Posted 2019-02-13T17:19:49.533

Reputation: 51

0

For those users I would do a checkup in case a custom field was configured.

Can you validate if you replace the PERSONAL.XLSB in C:\Users\user name\AppData\Local\Microsoft\Excel\XLStart, take one on a computer where it work, and check if it help Excel to respect your locale settings.

If yes, you could deploy the file by GPO to the others users

yagmoth555

Posted 2019-02-13T17:19:49.533

Reputation: 258

That file doesn't even exist. I should mention that all of this is done through Citrix servers. So I control all of the profiles and all that. But when I try to search for that file on my profile on the server, it isn't there. This example Excel report that I'm using is generated from Access directly and has no macros or anything. It's a blank document, besides those XML nodes. – ernest – 2019-02-13T17:32:07.587

@ernest oh, Citrix, I will update my answer then ! Can you check under HKEY_CURRENT_USER\Control Panel\International of a user in problem ? Citrix force the user settings, and not the server settings on connections. I had problem like that in the past, as even if the control panel show the correct setting, Citrix pushed the client setting anyway – yagmoth555 – 2019-02-13T17:38:39.887

@yagmouth555 I checked and it looks okay: https://i.imgur.com/TR0g0qI.png

– ernest – 2019-02-13T20:51:58.963