Problème langue arabe en Excel depuis un flexgrid
Slt tout le monde
J'essais de transférer le contenu d'un flexgrid vers un fichier Excel. J'utilise le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Dim xlObject As Excel.Application
Dim xlWB As Excel.Workbook
Set xlObject = New Excel.Application
'This Adds a new woorkbook, you could open the workbook from file also
Set xlWB = xlObject.Workbooks.Add
Clipboard.Clear 'Clear the Clipboard
With MSFlexGrid1
'Select Full Contents (You could also select partial content)
.Col = 0 'From first column
.Row = 0 'From first Row (header)
.ColSel = .Cols - 1 'Select all columns
.RowSel = .Rows - 1 'Select all rows
Clipboard.SetText .Clip 'Send to Clipboard
End With
With xlObject.ActiveWorkbook.ActiveSheet
.Range("A1").Select 'Select Cell A1 (will paste from here, to different cells)
.Paste 'Paste clipboard contents
End With
' This makes Excel visible
xlObject.Visible = True |
ça marche et c'est beaucoup plus rapide que de transférer les données cellule par cellule.
Le problème que j'ai c'est que les données du flexgrid, qui sont en langue arabe et qui s'affichent normalement en vb, ne le sont pas en Excel.
Avez vous une solution pour ce problème svp ?
Merci pour votre aide.