How to export VB6 TextBox data(Arabic) to MS Excel

451 views Asked by At

I am trying to export data contained in VB6 Text box to MS Excel in VB6. It works fine with English data, but not work with Arabic data. VB6 TextBox display both language(English and Arabic) correctly, also application exports English data correctly, however when it export Arabic data to excel, excel can not display it correctly. Excel display some garbage character in case of Arabic language.

I have tried to change the font of Excel sheet to some Arabic supported font like Arabic Typesetting, Arial Unicode MS, Microsoft Sans Serif etc but not succeeded. I did not found any way to change the font charset.

I am using Microsoft Excel 14.0 Object Library in my VB6 application to export data to Excel.

using following code:

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets("Sheet1")

xlSheet.Cells(1, 1).Value = TextBox.text
xlSheet.SaveAs "C:\Test.xlsx"

In above code TextBox contains the Arabic data.

0

There are 0 answers