I have a problem with the encoding of characters when I try to open an excel file....Let's say that the excel file has the following text:
Greek | English | German
α,β,γ .. | a,b,c,... | a,b,c...ä,ü,ö
I have just written the first three letters of the alphabet and in German some extra characters.
The code I use to open this excel file is
- Code: Select all
FileSelector.Title = "Load Excel File..."
FileSelector.InitialPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim path As String = FileSelector.BrowseFile(fileExtensions) 'Dim file As String = FileSelector.BrowseFile(FileType.Img)
If path Is Nothing Then 'If the user has chosen cancel
Return Nothing
End If
'read the file
doc = CompoundDocument.Read(path)
Dim bookdata As Byte() = doc.GetStreamData("Workbook")
book = New Workbook()
book.Read(New MemoryStream(bookdata))
The problem is that the extra characters in the German language are not read correctly, i.e.
- Code: Select all
MsgBox(book.Worksheets(0).Cells(1,2))
gives me as a result
- Code: Select all
a,b,c...?,?,?
instead of
- Code: Select all
a,b,c...ä,ü,ö
This problem doesn't appear in the greek language...
Thanks in advance


