nostra78
Messages postés137Date d'inscriptionjeudi 10 mars 2005StatutMembreDernière intervention 6 décembre 2005
-
13 mai 2005 à 15:48
jpleroisse
Messages postés1788Date d'inscriptionmardi 7 novembre 2000StatutMembreDernière intervention11 mars 2006
-
13 mai 2005 à 16:10
Je veux avoir accès à un fichier excel : sans l'ouvrir "qu'il soit workbook"
Je voudrais un truc du genre
App = "chemin/fichierexcel"
Dim TextLine
Open "" app For Input As #1
Do While Not EOF(1)
Line Input #1, TextLine
Debug.Print TextLine
Loop
Close #1 ' Ferme le fichier.
Sauf que j'aimerais savoir comment avoir accès à des feuilles et des cellule précises
Je dois surement créer un objet de type CreateObject... ??
Si quelqu'un pouvait m'aider
Ce serait cool
; je travail sous vba
jpleroisse
Messages postés1788Date d'inscriptionmardi 7 novembre 2000StatutMembreDernière intervention11 mars 200627 13 mai 2005 à 16:10
Bonjour,
Private Sub CommandButton1_Click()
Dim appExcel As Excel.Application
Dim wbExcel As Excel.Workbook
Dim Sheet As Excel.Worksheet
Dim wks As String
wks = "C:\Mes documents\Classeur4.xls"
Set appExcel = CreateObject("Excel.Application")
Set wbExcel = appExcel.Workbooks.Open(wks)
Set Sheet = appExcel.ActiveWorkbook.Worksheets(1)
'appExcel.Visible = True
TextBox1.Text = Sheet.Cells(1, 1).Value
TextBox2.Text = Sheet.Cells(1, 2).Value
End Sub