[VBA Excel] comment.cellule récup presse-pap

Fermé
Sérieux - 2 sept. 2007 à 14:31
 Utilisateur anonyme - 3 sept. 2007 à 16:03
Bonjour.

Quelqu'un peut-il me dire pourquoi cette instruction (en gras) ...

With ActiveCell.AddComment
.Visible = False
.Text GetFromClipboard
End With

... ne marche pas (Erreur d'exécution 1004 : La méthode 'Text' de l'objet 'Comment' a échoué) ?
A voir également:

1 réponse

Utilisateur anonyme
3 sept. 2007 à 16:03
Bonjour,

suggestion :

Option Explicit

Dim MaDonnee As DataObject
'

Sub CaptureDonnees()

    Dim Commentaires As String

    Set MaDonnee = New DataObject

    MaDonnee.GetFromClipboard
    Commentaires = MaDonnee.GetText(1)
    With ActiveCell.AddComment(Commentaires)
        .Visible = False
    End With

End Sub
'


Lupin
0