I am creating a VSTO addin for Excel 2007. All works fine on my development computer with English(UK) regional settings. However some end users will have other settings.
All works fine when adding information to the database, however when I try and fill a datatable with English(US) regional settings it fails.
Dim TA As New DB_InquiriesTableAdapters.qry_InquiriesTableAdapter
Dim DB As New DB_Inquiries.qry_InquiriesDataTable
TA.Fill(DB) 'FAILS HERE as date format is incorrect for regional settings
I have tried setting Thread.CurrentCulture in the addin startup but this throws and exception saying:
MSCORLIB Culture not supported
Anyone know how to get around this?
My original code was something like this:
It would throw an exception when trying to set the current culture.
New code:
The application is a VSTO Excel Addin written in VS2013 Professional and the class is linked to a WPF UserControl hosted in a Winforms Form.
Hope this helps explain the answer a little better.