cqfd@#!
Messages postés7Date d'inscriptionmardi 16 octobre 2012StatutMembreDernière intervention 7 février 2013
-
Modifié par cqfd@#! le 31/01/2013 à 13:24
Bonjour,
Je suis actuellement bloqué dans ma macro qui consiste à supprimer une inscription faite par une autre macro qui elle fonctionne. Je travaille avec open office 3.4.1.Jusque la j'ai réussis a bidouiller mes macros mais là je bloque.si quelqu'un a une solution à mon problème je suis preneur...
la ligne qui bloque est celle ou il y a "resultat=" (le dernier paragraphe du code que je n'ai pas mis en entier). J'ai le message variable d'objet non définie alors que je les aient declarer en debut de macro (comprend pas!?)
Sub Trouver_suppression()
Dim dlg8 As Object, bibli8 As Object
Dim monDialogue8 As Object, exitOK8 As Integer
Dim monDocument As Object, lesFeuilles As Object
Dim maFeuille As Object
Dim jeCherche As Object, posTrouve As Variant
dim maligne(100) as string
Dim cellule_numero,cellule_nomprenom,cellule_affectation,cellule_repas,cellule_niveauski as object
dim cellule_lundi,cellule_mardi,cellule_mercredi,cellule_jeudi,cellule_vendredi,cellule_samedi,cellule_dimanche as object
dim cellule_ski,cellule_piscine,cellule_tennis,cellule_equitation,cellule_tiralarc,cellule_vtt,cellule_escalade as object
dim resultat as string
dim j, aliste as integer
dim oListeBox as object
dim selection as string
dim leslignes, uneligne as object
Dialoglibraries.loadlibrary("Standard")
bibli8 = DialogLibraries.GetByName("Standard")
monDialogue8 = bibli8.GetByName("RECH")
dlg8 = CreateUnoDialog(DialogLibraries.Standard.RECH)
exitok8=com.sun.star.ui.dialogs.ExecutableDialogResults.OK
monDocument = ThisComponent
lesFeuilles = monDocument.Sheets
maFeuille = lesFeuilles.getByName("PostPermanent")
mazone=mafeuille.getCellRangeByName("B3:B2000")
leslignes=mafeuille.Rows
jeCherche = mazone.createSearchDescriptor
with jeCherche
.SearchString = champchoixnomsuppression
' rechercher les cellules contenant au moins ce texte
.SearchWords = false
.SearchByRow = true ' rechercher par lignes
end with
posTrouve = mazone.findFirst(jeCherche)
j=0
k=0
Do Until isNull(posTrouve)
maligne(k)=posTrouve.CellAddress.Row
cellule_numero=MaFeuille.getCellByPosition(0,maligne(k))
cellule_nomprenom=maFeuille.getCellByPosition(1,maligne(k))
cellule_affectation=maFeuille.getCellByPosition(2,maligne(k))
cellule_repas=maFeuille.getCellByPosition(3,maligne(k))
cellule_niveauski=maFeuille.getCellByPosition(4,maligne(k))
cellule_lundi = MaFeuille.getCellByPosition(5,maligne(k))
cellule_mardi = MaFeuille.getCellByPosition(7,maligne(k))
celulle_mercredi = MaFeuille.getCellByPosition(9,maligne(k))
cellule_jeudi = MaFeuille.getCellByPosition(11,maligne(k))
cellule_vendredi = MaFeuille.getCellByPosition(13,maligne(k))
cellule_samedi = MaFeuille.getCellByPosition(15,maligne(k))
cellule_dimanche = MaFeuille.getCellByPosition(17,maligne(k))
cellule_ski = MaFeuille.getCellByPosition(19,maligne(k))
cellule_piscine = MaFeuille.getCellByPosition(20,maligne(k))
cellule_tennis = MaFeuille.getCellByPosition(21,maligne(k))
cellule_equitation = MaFeuille.getCellByPosition(22,maligne(k))
cellule_tiralarc = MaFeuille.getCellByPosition(23,maligne(k))
cellule_vtt = MaFeuille.getCellByPosition(24,maligne(k))
cellule_escalade = MaFeuille.getCellByPosition(25,maligne(k))
resultat=cellule_numero.string & " " & cellule_nomprenom.string & " " & cellule_affectation.string & " " & cellule_repas.string & " " & cellule_niveauski.string & " " & cellule_lundi.string & " " & cellule_mardi.string & " " & cellule_mercredi.string & " " & cellule_jeudi.string & " " & cellule_vendredi.string & " " & cellule_samedi.string & " " & cellule_dimanche.string & " " & cellule_ski.string & " " & cellule_piscine.string & " " & cellule_tennis.string & " " & cellule_equitation.string & " " & cellule_tiralarc.string & " " & cellule_vtt.string & " " & cellule_escalade.string