Click here to Skip to main content
15,908,445 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi how can I set coding windows-1250 in this code?

thank you

What I have tried:

I tried to change textplatform to 1250 but nothing happen.


Private Sub konverze(sender As Object, e As EventArgs)
       Dim msExcelApplication As New Microsoft.Office.Interop.Excel.Application()
       Dim workBook As Microsoft.Office.Interop.Excel.Workbook = msExcelApplication.Workbooks.Open("C:\Users\cahafi\Documents\vbexcel.xlsx", 0, False, Type.Missing, "", "", True, Type.Missing, Type.Missing, True, False, Type.Missing, True, False, False)
       Try
           Dim workSheet As Microsoft.Office.Interop.Excel.Worksheet = workBook.Sheets(1)
           With workSheet.QueryTables.Add(Connection:="TEXT;C:\Users\cahafi\Documents\vbexcel.csv", Destination:=workSheet.Range("$A$1"))
               .Name = "vbexcel"
               .FieldNames = True
               .RowNumbers = False
               .FillAdjacentFormulas = False
               .PreserveFormatting = True
               .RefreshOnFileOpen = False
               .SavePassword = False
               .RefreshStyle = Microsoft.Office.Interop.Excel.XlCellInsertionMode.xlInsertDeleteCells
               .SaveData = True
               .AdjustColumnWidth = True
               .RefreshPeriod = 0
               .TextFilePromptOnRefresh = False
               .TextFilePlatform = 1250
               .TextFileStartRow = 1
               .TextFileParseType = Microsoft.Office.Interop.Excel.XlTextParsingType.xlDelimited
               .TextFileTextQualifier = Microsoft.Office.Interop.Excel.XlTextQualifier.xlTextQualifierDoubleQuote
               .TextFileConsecutiveDelimiter = False
               .TextFileTabDelimiter = False
               .TextFileSemicolonDelimiter = False
               .TextFileCommaDelimiter = True
               .TextFileSpaceDelimiter = False
               .TextFileTrailingMinusNumbers = True
               .Refresh(BackgroundQuery:=False)
           End With
       Catch ex As Exception
           Console.WriteLine(ex.ToString())
           Console.ReadLine()
       Finally
           workBook.Close(True)
       End Try


   End Sub
Posted
Updated 29-May-19 4:02am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900