| |
kalihoste
Posts: 1
Score: 0
Joined: 6/12/2008
Status: offline
|
Hi, I have a problem to read combobox created by the excel formular tools value from an Excel file. Here is the code : ############################################################################# Private Sub ListeFichiersDansDossier(ByVal NomFeuille, ByVal TypeFichier, ByVal NomDossierSource, ByVal InclureSousDossiers) Dim FSO, DossierSource, SousDossier, Fichier, Extension, appExcel, wbexcel Dim listeObjets Set FSO = CreateObject("Scripting.FileSystemObject") Set DossierSource = FSO.GetFolder(NomDossierSource) Set appExcel = CreateObject("Excel.Application") Set listeObjets = CreateObject("Excel.ListObject") 'Parcours du dossier parent For Each Fichier In DossierSource.Files Extension = UCase(FSO.GetExtensionName(Fichier)) Set wbexcel = appExcel.Workbooks.Open(Fichier) If InStr(Fichier.Name, Chr(39)) > 0 Then Fichier.Name = Replace(Fichier.Name, Chr(39), "" ) If UCase(TypeFichier) = Extension Then Wscript.Echo "Id : " & wbexcel.Worksheets(1).Cells(5, 2).value 'Here is the line Wscript.Echo "Id : " & wbexcel.Worksheets(1).Zonecombinée12_QuandChangement.value 'I got another error here when I want to see the worksheet objects Set listeObjets = wbexcel.Worksheets(1).ListObjects Wscript.Echo "The list object covers the range " & listeObjets.ToString End If wbexcel.Close Next Set appExcel = Nothing Set wbexcel = Nothing Set Fichier = Nothing Set DossierSource = Nothing Set FSO = Nothing Exit Sub End Sub ############################################################################# Thanks you for your help.
|
|