Bonjour Voici une nouvelle question envoyée à l'aide du formulaire de demande d'aide (http://fr.libreoffice.org/get-help/poser-une-question/). Si vous répondez, merci de penser à utiliser la fonction "répondre à tous" de votre logiciel de courrier électronique de façon que le demandeur reçoive une copie de votre réponse.
Email: - [email protected] Sujet: - Calc ouverture multiples fichiers Question: - Bonjour, J'aie créé un bout de programme qui a pour but d'aller chercher des informations dans des fichiers calc identiques (un par nom). Ce fichier Synthèse teste la présence des fichiers source, les ouvre s'ils existent, récuppère la donnée et referme le fichier source. code : Dim DocSource as object Dim DocSynth as object Dim Args(0) as new com.sun.star.beans.PropertyValue dim oDesktop as Object dim NomFichier,nom,pac as string dim LDocSynth,LDocSource as integer dim i as integer sub TesteExistanceNomFichier DocSynth = ThisComponent oDesktop = createUnoService( "com.sun.star.frame.Desktop" ) LDocSynth = 3 Args(0).name = "Hidden" Args(0).value = true DocSynth.currentController.setActiveSheet(DocSynth.sheets(1)) for i = 4 to 10 NomFichier = DocSynth.sheets(0).getcellbyposition(5,i).string nom = DocSynth.sheets(0).getcellbyposition(2,i).string pac = DocSynth.sheets(0).getcellbyposition(3,i).string if FileExists (NomFichier) then DocSource = oDesktop.LoadComponentFromURL( NomFichier ,"_blank",0, Args()) for LDocSource = 7 to 30 if DocSource.sheets(5).getcellbyposition(1,LDocSource).string <>"" then LDocSynth = LDocSynth + 1 DocSynth.sheets(1).getcellbyposition(0,LDocSynth).string = nom DocSynth.sheets(1).getcellbyposition(1,LDocSynth).string = pac for colsynth = 2 to 12 DocSynth.sheets(1).getcellbyposition(colsynth,LDocSynth).string = DocSource.sheets(5).getcellbyposition(colsynth-1,LDocSource).string next colsynth end if if DocSource.sheets(5).getcellbyposition(1,LDocSource).string ="" then DocSource.close(True) wait(200) exit for end if next LDocSource DocSynth.sheets(0).getcellbyposition(6,i).string = "OK" end if next i msgbox ("terminé") end sub quand je limite à 3 ou 4 fichiers, le code fonctionne, au delà libre office envoie un message d'erreur. qu'est ce que j'oublie ? -- Envoyez un mail à [email protected] pour savoir comment vous désinscrire Les archives de la liste sont disponibles à http://listarchives.libreoffice.org/fr/users/ Tous les messages envoyés sur cette liste seront archivés publiquement et ne pourront pas être supprimés
