ahmani24
Messages postés39Date d'inscriptionmardi 13 avril 2004StatutMembreDernière intervention14 novembre 2006 25 oct. 2006 à 00:46
hello ,
inspire toi de ca
Dim Exc As Excel.Application
Set Exc = New Excel.Application
Exc.Visible = True
Exc.Workbooks.Add
Exc.Sheets("Feuil2").Select
Exc.Sheets("Feuil2").Name = "MonDoc"
cs_kazer04
Messages postés182Date d'inscriptionjeudi 14 juillet 2005StatutMembreDernière intervention14 mars 2011 25 oct. 2006 à 00:10
en supossant que tes sur vb.net
Public Sub export()
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = CType(CreateObject("Excel.Application"), Excel.Application)
xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook)
' Tu peux toujours decider de remplire un fichier excell existant tu utilise la ligne qui suis en precisant le chemein de ce fichier
'xlBook = CType(xlApp.Workbooks.Open(MON_CHEMIN_FICHIER_XLS), Excel.Workbook)
xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet)
dim y as integer
'tu range dans NB_LIGNE le nombre d'element que ta dans ton combobox
'j'ai pas le code en tete
For y = 0 To NB_LIGNE
xlSheet.Cells(y + 2, 1) = TON_COMBO.Items(y).ToString
xlSheet.Application.Visible = True
xlApp.Quit()
xlSheet = Nothing
xlBook = Nothing
xlApp = Nothing
End Sub