Laurent Godard <lgodard <at> indesko.com> writes:

> 
> Bonjour William
> 
> > je débute en programmation macro et basic dans calc.
> >
> 
> bienvenue
> je t'invite à rejoindre la liste prog <at> fr.openoffice.org dédiée au 
> scripting de OOo
> 
> > Après redémarrage de l'ordi, la macro ne fonctionne plus : j'ai des erreurs
> > "Syntax error Basic else/end if sans if"
> > "Syntax error Basic symbole innatendu end sub"
> > 
> > Si quelqu'un sait d'où cela peut venir ?
> 
> sans la macro celà va etre difficile :(
> 
> Laurent
> 
1 ère macro
Sub Tassement_Repartie
        dim oSheet, oDoc, oCell as object
        dim xPos, yPos as integer
        dim TempValue, Ix as variant
        oDoc = StarDesktop.CurrentComponent
        oSheet = oDoc.sheets.getByName("support multicouche")
'Itération pour déterminer les tassements       
        Do
        'Détermination des I(x)
        xPos =3
        For yPos = 67 to 390
                oCell = oSheet.getCellByPosition(xPos-1,yPos)
                TempValue = oCell.GetValue
                oCell = oSheet.getCellByPosition(10,30)
                oCell.Value = TempValue
                oCell = oSheet.getCellByPosition(15,38)
                Ix = oCell.GetValue
                oCell = oSheet.getCellByPosition(xPos,yPos)
                oCell.Value = Ix
        Next yPos       
End sub

2 èmez macro
Sub CALCUL_DEQ
'Détermination des variables de la procédure
        dim oSheet, oDoc, oCell as object
        dim xPos, yPos as integer
        dim TempValue, IOhi, IObi as variant
        dim Deq, TempDeq as variant
'Sélection du document courant
        oDoc = ThisComponent.CurrentComponent
'Sélection de la feuille
        oSheet = oDoc.sheets.getByName("support multicouche")
'Valeur de Deq de base
        oCell = oSheet.getCellByPosition(2,19)
        TempDeq = oCell.Value*15
'Itération pour déterminer Deq  
        Do
                'Indication de la valeur de Deq
                oCell = oSheet.getCellByPosition(1,25)
                oCell.value = TempDeq
                'Détermination des I(O,hi)
                xPos = 7
                For yPos = 2 to 7
                        oCell = oSheet.getCellByPosition(xPos-1,yPos)
                        TempValue = oCell.GetValue
                        oCell = oSheet.getCellByPosition(14,2)
                        oCell.Value = TempValue
                        oCell = oSheet.getCellByPosition(15,5)
                        IOhi = oCell.GetValue
                        oCell = oSheet.getCellByPosition(xPos,yPos)
                        oCell.Value = IOhi
                Next yPos
                'Détermination des I(O,bi)      
                xPos = 9
                For yPos = 2 to 7
                        oCell = oSheet.getCellByPosition(xPos-1,yPos)
                        TempValue = oCell.GetValue
                        oCell = oSheet.getCellByPosition(14,2)
                        oCell.Value = TempValue
                        oCell = oSheet.getCellByPosition(15,5)
                        IObi = oCell.GetValue
                        oCell = oSheet.getCellByPosition(xPos,yPos)
                        oCell.Value = IObi
                Next yPos
                'Récupération de la valeur de Deq calculée
                oCell = oSheet.getCellByPosition(3,25)
                Deq = oCell.GetValue
                'Incrémentation de la valeur temporaire de Deq si elle ne 
coïncide pas avec
Deq calculé
                If TempDeq < Deq then TempDeq = TempDeq * 1.01
                                                 else TempDeq = TempDeq * 0.99
                end if
        'Demande de vérifier la coïncidence des Deq
        loop while MsgBox("Est-ce que les Deq coïncident ? ",4,"Vérification")=7
end sub

si c'est plus clair...



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Répondre à