Solved

programmatically read a cell comment

Posted on 1998-12-07
2
228 Views
Last Modified: 2006-11-17
i want to programmatically read a cell comment (in VB)

to write the comment, i can do, for example:
Range("A1").Comment.TEXT TEXT:="user:" & Chr(10) & "some words"

but there doesn't seem to be anything to read it back.
0
Comment
Question by:mickeydog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
frazer earned 50 total points
ID: 1614885
Hi,

This will assign the variable to 'a' and then display it in a message box....

Sub hello()
    Dim XL As New Excel.Application
    Dim wbk As Workbook
    Dim a As String
    Set wbk = XL.Workbooks.Add
    Range("A1").AddComment "Hello"
    a = Range("A1").Comment.Text
    MsgBox a
    Set wbk = Nothing
    Set XL = Nothing
End Sub


Hope this helps

Frazer
0
 

Author Comment

by:mickeydog
ID: 1614886
thanks!
hope there's no grading mixup this time!

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question