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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to insert a comment to an excel sheet with aspect?

Status
Not open for further replies.

alberto1974

Technical User
Jul 20, 2004
10
US
Hi everybody,
I was wondering if somebody know how to insert a comment to excell with aspect script, I know how to pick and poke data from to excel's cells but for a new script that I am trying to write I need comments.
I already read the Microsoft excel 4.0 Macro functions, but I can't find the way to insert comments.
Can somebody help me?
Thanks
 
I have not tried this before, but a quick look at the Excel DDE help file I link to from my site shows that NOTE may be the command you want. I've copied the discussion of it below:

NOTE
Macro Sheets Only
Equivalent to choosing the Comment command from the Insert menu. Creates a comment or replaces text characters in a comment.

Syntax

NOTE(add_text, cell_ref, start_char, num_chars)
NOTE?( )

Add_text is text of up to 255 characters you want to add to a comment. Add_text must be enclosed in quotation marks.

If add_text is omitted, it is assumed to be "" (empty text).

Cell_ref is the cell to which you want to add the comment text. If cell_ref is omitted, add_text is added to the active cell's comment.

Start_char is the number of the character at which you want add_text to be added. If start_char is omitted, it is assumed to be 1. If there is no existing comment, start_char is ignored.

Num_chars is the number of characters that you want to replace in the comment. If num_chars is omitted, it is assumed to be equal to the length of the comment.

Remarks

NOTE returns the number of the last character entered in the comment. This is useful if you want to know how many characters are in the text string so it can be manipulated with other functions such as RIGHT, LEFT, and MID.
The dialog-box form of this function, NOTE?, takes no arguments.
NOTE() deletes the comment attached to the active cell.

To find out if a cell has a comment attached to it, use GET.CELL.

Related Functions

GET.NOTE Returns characters from a comment

 
Hi Knob,
Today I was trying with many combinations using NOTE and I couldn't write a comment to excel. I am using excel 2000
Thank You
 
No I couldn't make it function, even with visual basic, but it only gives me the message something like "foreign application doesn't recognize the command", I don't know it could be that excel doesn't accept the command NOTE anymore.
 
I worked on this some as well and had no luck setting a comment. I can only assume that the macro in Excel has changed somewhat and needs to be called a bit differently, but couldn't find anything obvious with a web search.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top