View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] kletcho@gmail.com is offline
external usenet poster
 
Posts: 11
Default reading and modifying file comments

Are you creating a VB script that runs outside of Excel or are you in
Excel running this procedure? If you are creating a VB script I would
create and Excel Object and then access the comments through that
object and go from there as you normally would if programming in VBA.

Dim xlApp
Dim xlBook
Dim strFileName

strFileName = "c:\MyFile.xls"
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.WorkBooks.Open(filename)

Range("A1").Comments.Text = "Hello"

If you are programming in VBA and in excel then you can just skip the
first part and just use Range("A1").Comments.Text = "Hello".