Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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 can't start inserting data into rows and cells. The Excel and a workbook open fine, but the data won't go in.

 

Any suggestions?

 

Thanks

  • 5 years later...
  • 8 months later...
Posted

C:\Program Files\Microsoft Office\OFFICE11

and copy the Excel.exe and paste it in the same directory.

Rename the new file xllex.dll and wala! excelobj.Workbooks.Open("anyfile.xls")

will work ;)

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...