Range VBA Erreur 1004

Bonjours tous le monde j'ai une erreur dans mon code mais je ne voit pas pourquoi ça me met Erreur 1004 et me souligne cette ligne : .To = Range(client_Email).Value

merci d'avance de votre aides

Voila mon bout de code :

Sub btn_mail_Click()

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ActiveWorkbook.Path & "\" & "Devis-" & USF_client.txt_nomclient.Value & ".PDF"

Dim mMessage As Object
Dim mConfig As Object
Dim mChps

SMTPSERVER = "smtp.gmail.com"
SMTPPORT = 25
USER = "***"
PWD = "***"

     Set mConfig = CreateObject("CDO.Configuration")

     mConfig.Load -1
     Set mChps = mConfig.Fields

     With mChps
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPSERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPORT
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = USER
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = PWD
         .Update
     End With

     Set mMessage = CreateObject("CDO.Message")
     With mMessage
     Set .Configuration = mConfig
         .From = USER
         .To = Range(client_Email).Value
         .Subject = "Devis planche"
         .TextBody = "Bonjour"
         .AddAttachment ActiveWorkbook.Path & "\" & "Devis-" & USF_client.txt_nomclient.Value & ".PDF"
         .Send
     End With
     Set mMessage = Nothing

     'Libère les ressources
     Set mConfig = Nothing
     Set mChps = Nothing
     USF_pmi.Hide
End Sub

Bonjour,

Dans Range(client_Email), client_Email c'est quoi?

Une variable? Un contrôle? Une cellule nommée?

bonjours

ceci et ne cellule de ma page Excel que je nomme avec un userform.


voila mon fichier si ça peut aider

voila mon fichier si ça peut aide

Non. Pas la peine.

Par contre édite ton message et efface ton fichier tout de suite.

Il est plein de données personnelles.

Encadre simplement client_Email de guillemets :

Range("client_Email").Value

ah oui c’était juste ça j'ai pas pense a vérifier merci bien

Rechercher des sujets similaires à "range vba erreur 1004"