Bonjour, j'ai trouv=E9 le code suivant sur Excelabo.net
J'ai tent=E9 de le r=E9adapter =E0 mes besoins : je veux que mes=20
utilisateurs, lorsqu'ils saisissent des donn=E9es soient=20
amen=E9s =E0 valider en cliquant sur un bouton, et je veux que=20
cette "validation" m'envoie un mail pour me pr=E9venir.=20
Aussi j'ai r=E9adapt=E9 votre code comme suit avec en M1 le=20
texte que je veux recevoir.
Or, j'ai une erreur d'ex=E9cution '9' [l'indice n'appartient=20
pas =E0 la s=E9lection] sur la ligne=20
With .VBProject.VBComponents=20
_ActiveSheet.Name).CodeModule; pourriez vous me d=E9panner ?
Merci par avance
Franck B.
Sub EnvoiPlageDonn=E9eParCourriel()
Dim Plage As Range, T As Variant, A As Long
Dim Shap As Object, B As Integer
Application.ScreenUpdating =3D False
With Worksheets("Feuil1")
Set Plage =3D Worksheets("Saisie").Range("M1")
T =3D Plage
.Copy
End With
A =3D Plage.Rows.Count
B =3D Plage.Columns.Count
With ActiveWorkbook
With .VBProject.VBComponents=20
_ActiveSheet.Name).CodeModule
.deletelines 1, .countoflines
End With
With .ActiveSheet
.Cells.Clear
.Range(Cells(1, 1), Cells(A, B)) =3D T
For Each Shap In .Shapes
Shap.Select Replace:=3DFalse
Next
Selection.Delete
End With
SendKeys "(%{E})", False
.SendMail Recipients:=3D"bernard@tolbiac;inserm.fr",=20
Subject:=3D"Test"
.Close savechanges:=3DFalse
End With
Set Plage =3D Nothing: Set Shap =3D Nothing
Je t'envois un fichier propre sur ta messagerie, il devrait pouvoir répondre à ton besoin une fois adapté. Il te suffit d'appeler la macro en fin de procédure et le corps de message apparaitra.
Bien à toi,
-----Message d'origine----- Bonjour, j'ai trouvé le code suivant sur Excelabo.net
J'ai tenté de le réadapter à mes besoins : je veux que mes
utilisateurs, lorsqu'ils saisissent des données soient amenés à valider en cliquant sur un bouton, et je veux que
cette "validation" m'envoie un mail pour me prévenir. Aussi j'ai réadapté votre code comme suit avec en M1 le texte que je veux recevoir.
Or, j'ai une erreur d'exécution '9' [l'indice n'appartient
pas à la sélection] sur la ligne With .VBProject.VBComponents _ActiveSheet.Name).CodeModule; pourriez vous me dépanner ?
Merci par avance
Franck B.
Sub EnvoiPlageDonnéeParCourriel()
Dim Plage As Range, T As Variant, A As Long Dim Shap As Object, B As Integer
Application.ScreenUpdating = False With Worksheets("Feuil1") Set Plage = Worksheets("Saisie").Range("M1") T = Plage .Copy End With
A = Plage.Rows.Count B = Plage.Columns.Count
With ActiveWorkbook With .VBProject.VBComponents _ActiveSheet.Name).CodeModule .deletelines 1, .countoflines End With With .ActiveSheet .Cells.Clear .Range(Cells(1, 1), Cells(A, B)) = T For Each Shap In .Shapes Shap.Select Replace:úlse Next Selection.Delete End With SendKeys "(%{E})", False .SendMail Recipients:=";inserm.fr", Subject:="Test" .Close savechanges:úlse End With Set Plage = Nothing: Set Shap = Nothing
End Sub
.
Bonjour Bernard,
Je t'envois un fichier propre sur ta messagerie, il
devrait pouvoir répondre à ton besoin une fois adapté.
Il te suffit d'appeler la macro en fin de procédure et le
corps de message apparaitra.
Bien à toi,
-----Message d'origine-----
Bonjour, j'ai trouvé le code suivant sur Excelabo.net
J'ai tenté de le réadapter à mes besoins : je veux que
mes
utilisateurs, lorsqu'ils saisissent des données soient
amenés à valider en cliquant sur un bouton, et je veux
que
cette "validation" m'envoie un mail pour me prévenir.
Aussi j'ai réadapté votre code comme suit avec en M1 le
texte que je veux recevoir.
Or, j'ai une erreur d'exécution '9' [l'indice
n'appartient
pas à la sélection] sur la ligne
With .VBProject.VBComponents
_ActiveSheet.Name).CodeModule; pourriez vous me dépanner ?
Merci par avance
Franck B.
Sub EnvoiPlageDonnéeParCourriel()
Dim Plage As Range, T As Variant, A As Long
Dim Shap As Object, B As Integer
Application.ScreenUpdating = False
With Worksheets("Feuil1")
Set Plage = Worksheets("Saisie").Range("M1")
T = Plage
.Copy
End With
A = Plage.Rows.Count
B = Plage.Columns.Count
With ActiveWorkbook
With .VBProject.VBComponents
_ActiveSheet.Name).CodeModule
.deletelines 1, .countoflines
End With
With .ActiveSheet
.Cells.Clear
.Range(Cells(1, 1), Cells(A, B)) = T
For Each Shap In .Shapes
Shap.Select Replace:=False
Next
Selection.Delete
End With
SendKeys "(%{E})", False
.SendMail Recipients:="bernard@tolbiac;inserm.fr",
Subject:="Test"
.Close savechanges:=False
End With
Set Plage = Nothing: Set Shap = Nothing
Je t'envois un fichier propre sur ta messagerie, il devrait pouvoir répondre à ton besoin une fois adapté. Il te suffit d'appeler la macro en fin de procédure et le corps de message apparaitra.
Bien à toi,
-----Message d'origine----- Bonjour, j'ai trouvé le code suivant sur Excelabo.net
J'ai tenté de le réadapter à mes besoins : je veux que mes
utilisateurs, lorsqu'ils saisissent des données soient amenés à valider en cliquant sur un bouton, et je veux que
cette "validation" m'envoie un mail pour me prévenir. Aussi j'ai réadapté votre code comme suit avec en M1 le texte que je veux recevoir.
Or, j'ai une erreur d'exécution '9' [l'indice n'appartient
pas à la sélection] sur la ligne With .VBProject.VBComponents _ActiveSheet.Name).CodeModule; pourriez vous me dépanner ?
Merci par avance
Franck B.
Sub EnvoiPlageDonnéeParCourriel()
Dim Plage As Range, T As Variant, A As Long Dim Shap As Object, B As Integer
Application.ScreenUpdating = False With Worksheets("Feuil1") Set Plage = Worksheets("Saisie").Range("M1") T = Plage .Copy End With
A = Plage.Rows.Count B = Plage.Columns.Count
With ActiveWorkbook With .VBProject.VBComponents _ActiveSheet.Name).CodeModule .deletelines 1, .countoflines End With With .ActiveSheet .Cells.Clear .Range(Cells(1, 1), Cells(A, B)) = T For Each Shap In .Shapes Shap.Select Replace:úlse Next Selection.Delete End With SendKeys "(%{E})", False .SendMail Recipients:=";inserm.fr", Subject:="Test" .Close savechanges:úlse End With Set Plage = Nothing: Set Shap = Nothing