Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Excel : read a formular combobox value

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61332
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Excel : read a formular combobox value
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Excel : read a formular combobox value - 6/12/2008 11:41:38 PM   
  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.
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Excel : read a formular combobox value Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts