J'ai utiliser Microsoft Excel feuille ..J'ai tombé différentes valeurs dans Excel feuille il n'y a pas de problème .. mais j'ai tombé quelques colonnes numériques comme ceci (00023785678) .. dans ce colonnes premier zéro n'est pas l'obtenir .. donc je suis allé changer la colonne dans le format de cellules de texte ..Cellule Excel Format Changements dans le texte
comment créer dans le code Vb.net .. déjà je suis tombé excel feuille cette méthode ...
Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim columnrange = oSheet.Columns
Dim therange = oSheet.UsedRange
' Dim wb As Microsoft.Office.Interop.Excel.Workbook
''Dim style As Microsoft.Office.Interop.Excel.Style
oXL = CreateObject("Excel.Application")
oXL.Visible = True
oWB = oXL.Workbooks.Add
oSheet = oWB.ActiveSheet
'oXL.Selection.num()
oXL.Selection.NumberFormat = "Text"
For c As Integer = 0 To dt.Columns.Count - 1
oSheet.Cells(1, c + 1).Value = dt.Columns(c).ColumnName
Next
For rCnt As Int16 = 2 To therange.Rows.Count
Dim rowArray(therange.Columns.Count) As String
For cCnt As Int16 = 1 To therange.Columns.Count
Dim Obj = CType(therange.Cells(rCnt, cCnt), Excel.Range)
Dim celltext As String
celltext = Obj.Value.ToString
rowArray((cCnt - 1)) = celltext
Next
Next
For r As Integer = 0 To dt.Rows.Count - 1
For c As Integer = 0 To dt.Columns.Count - 1
oSheet.Cells(r + 2, c + 1).Value = dt.Rows(r)(c)
oSheet.Cells(r + 2, c + 1).numberformat = "0"
Next
Next
'With oWB
' .Cells(seriesName.GetUpperBound(0) + 7, 3).numberformat = "#.00"
' .Cells(seriesName.GetUpperBound(0) + 7, 5).numberformat = "0"
'End With
'With oSheet.Range("A1", "ZZ1")
' .Font.Bold = True
' .VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
' .HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter
' .EntireColumn.AutoFit()
' .EntireRow.AutoFit()
'End With
Dim FirstRow As Long
Dim SecentRow As Long
Dim ThirdRow As Long
With oSheet.Range("A1", "BD1")
FirstRow = 1
SecentRow = 2
ThirdRow = 3
.Rows(0 + 1).EntireRow.Insert()
.Rows(0 + 1).EntireRow.Insert()
.Rows(0 + 1).EntireRow.Insert()
.Font.Bold = True
.VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
.HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter
.EntireColumn.AutoFit()
.EntireRow.AutoFit()
'.EntireRow.TextToColumns()
.Offset.Justify()
.Offset.BorderAround()
.Offset.WrapText = True
.Offset.Select()
End With
Mais maintenant idon't obtenir les ans ... à pls help me ...