Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Comment author (ExcelXP)

    This is an old one without an answer still, as its been a while, I'm re-trying <img src=/S/blackteeth.gif border=0 alt=blackteeth width=20 height=20>...

    When making cell comments using VB-code, the comment author is the author string set in the application. I'd like to have comments added with the author e.g. as "Comment added by MyProgram v1.2".

    There is a workaround where first the current application author is saved in a string, then the Author is set to the intended string and the comment is created. Next the original (saved) string is re-applied and all is OK again.

    The risk is that if something happens with the VBA code while the temporary author is still set, it will stick from there onward (and also be visible in all other Office components!).

    I'd be looking for a way to set (and/or change) the author for a comment without touching the 'application author' string. I'm sure it can't be done in normal VBA but maybe there's someone out there who has figured out how to get here using e.g. a direct API call?

    Anyway... just trying <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

    Erik Jan

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Comment author (ExcelXP)

    I am a little confused. How are the comments being created?

    If you are creating the comments in VB, I don't understand why the current user name is even being added. You can put whatever text you want in the comment, add a different name, add no name, etc. There is no need to change the UserName

    When you create the comment from excel, excel adds the username, so you would have to change the username, if you wanted a different name, or modify the comments after the fact to change the name it added.

    Steve

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Comment author (ExcelXP)

    Sorry,

    I'm talking about the text displayed in the Excel status line when a cell-comment is displayed

    Erik Jan

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Comment author (ExcelXP)

    The only way I know of is the way youpropose: Changing the UserName before creating the comment, creating the comment and then restoring the username.

    The Comment object does have an "Author" property but this is read-only, so can not be changed afterwards.

    You can alleviate some of the concern about the changing the username "sticking" after an error, by adding the "restore username" to some sort of error handling. Perhaps even create a "defined name" containing the original username, and restore it in the workbook close return. Yes this won't help if there is a application crash, but that is the risk...

    As far as I know, changing excel's "Username" should not affect other office applications "usernames". I thought they are all stored separately (at least they were in XL97, XLXP may be different)

    Steve

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •