Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ho w to insert a comment to excel cell through DDE with VB

Status
Not open for further replies.

alberto1974

Technical User
Jul 20, 2004
10
US
Hello everybody I was wondering if somebody knows how to insert a comment to an excel cell using DDE commands I was experimenting with the example "LinkExecute Method Example" from VB, but I couldn't insert a comment to the cell I was using the excel command "NOTE(add_text, cell_ref, start_char, num_chars)" from XLMACR8.hlp, but I always get the error message something like this "Foreign application don't accept or recognize the command"

Thank You.
 
Assuming that you have instantiated an Excel object from VB you can use this with your Worksheet Object:
Code:
With myRange
    .AddComment
    .Comment.Visible = False
    .Comment.Text Text:="My commentary text"
    End With

You can often get a good idea of the VB code to use from using the Macro recorder in Excel, then going to the VB Editor in Excel and copyinhg the code from there. You will need to change the object references of course.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Is there a particular reason you want to use the now rather aging DDE?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top