Old format or invalid type library error

IxiRancid

Well-known member
Joined
Jun 16, 2004
Messages
104
Location
Europe
This would mostly be like a warning or a help to every non-american native user of VS.NET

I had this problem trying to open an Excel workbook to pump some data into.
The error pops up if your Office system is english version and regional settings are non-US.
You could use Multilanguage pack, however my company has a policy of not installing those packs, so I found this solution:

------taken from microsoft.com (here) --------
Dim oApp As New Excel.Application()
oApp.Visible = True
oApp.UserControl = True
Dim oBooks As Object = oApp.Workbooks
Dim ci As System.Globalization.CultureInfo = New System.Globalization.CultureInfo("en-US")
oBooks.GetType().InvokeMember("Add", Reflection.BindingFlags.InvokeMethod, Nothing, oBooks, Nothing, ci)
--------------------------------------

Now that would be the solution part, however I have a problem with continuing the code... I cant start inserting data into rows and cells. The Excel and a workbook open fine, but the data wont go in.

Any suggestions?

Thanks
 
Back
Top