Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
Daniel.j
Bonjour, Comme cela: 'ajouter la librairie excel 'projetajouter référenceonglet: com 'et ensuite ajouter microsoftexcel 10.0 object librairie
'Déclaration des variables pour utiliser excel Dim xlapp As Excel.Application Dim xlbook As Excel.Workbook Dim xlsheet As Excel.Worksheet 'Affectation des variables xlapp = CType(CreateObject("Excel.Application"), Excel.Application) 'ouverture du fichier excel (C:ajetertest.xls) xlapp.Workbooks.Open(FileName:="C:ajetertest.xls", Editable:=True, ReadOnly:úlse) xlapp.Visible = True 'Affectation des variables xlbook = CType(xlapp.Workbooks(1), Excel.Workbook) xlsheet = CType(xlapp.Worksheets(1), Excel.Worksheet)
'Ecris dans la 1 ligne, 1 colonne xlsheet.Cells(1, 1) = TextBox1.Text
'Sauvegarde le fichier xlbook.Save()
'Quitte l'application xlapp.Quit()
-- Daniel =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Foire Aux Questions Microsoft Public Fr Excel FAQ MPFE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Adresse: http://dj.joss.free.fr/faq.htm "Eric" a écrit dans le message de news:
bonjour comment on fait pour lire une cellule d'un fichier excel merci
Bonjour,
Comme cela:
'ajouter la librairie excel
'projetajouter référenceonglet: com
'et ensuite ajouter microsoftexcel 10.0 object librairie
'Déclaration des variables pour utiliser excel
Dim xlapp As Excel.Application
Dim xlbook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
'Affectation des variables
xlapp = CType(CreateObject("Excel.Application"), Excel.Application)
'ouverture du fichier excel (C:ajetertest.xls)
xlapp.Workbooks.Open(FileName:="C:ajetertest.xls", Editable:=True,
ReadOnly:úlse)
xlapp.Visible = True
'Affectation des variables
xlbook = CType(xlapp.Workbooks(1), Excel.Workbook)
xlsheet = CType(xlapp.Worksheets(1), Excel.Worksheet)
'Ecris dans la 1 ligne, 1 colonne
xlsheet.Cells(1, 1) = TextBox1.Text
'Sauvegarde le fichier
xlbook.Save()
'Quitte l'application
xlapp.Quit()
--
Daniel
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Foire Aux Questions Microsoft Public Fr Excel
FAQ MPFE
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Adresse: http://dj.joss.free.fr/faq.htm
"Eric" <rasha_500@yahoo.fr> a écrit dans le message de news:
eK1MUEabFHA.2984@TK2MSFTNGP15.phx.gbl...
bonjour
comment on fait pour lire une cellule d'un fichier excel
merci
Bonjour, Comme cela: 'ajouter la librairie excel 'projetajouter référenceonglet: com 'et ensuite ajouter microsoftexcel 10.0 object librairie
'Déclaration des variables pour utiliser excel Dim xlapp As Excel.Application Dim xlbook As Excel.Workbook Dim xlsheet As Excel.Worksheet 'Affectation des variables xlapp = CType(CreateObject("Excel.Application"), Excel.Application) 'ouverture du fichier excel (C:ajetertest.xls) xlapp.Workbooks.Open(FileName:="C:ajetertest.xls", Editable:=True, ReadOnly:úlse) xlapp.Visible = True 'Affectation des variables xlbook = CType(xlapp.Workbooks(1), Excel.Workbook) xlsheet = CType(xlapp.Worksheets(1), Excel.Worksheet)
'Ecris dans la 1 ligne, 1 colonne xlsheet.Cells(1, 1) = TextBox1.Text
'Sauvegarde le fichier xlbook.Save()
'Quitte l'application xlapp.Quit()
-- Daniel =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Foire Aux Questions Microsoft Public Fr Excel FAQ MPFE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Adresse: http://dj.joss.free.fr/faq.htm "Eric" a écrit dans le message de news:
bonjour comment on fait pour lire une cellule d'un fichier excel merci