Solved

When inserting comment in Excel 2007 on Terminal Server the user is always the same no matter who is logged in

Posted on 2011-03-03
3
368 Views
Last Modified: 2012-05-11
Hi,

We have a Terminal Server running Office 2007 and some other finance related programs. Because it is finance they use Excel heavily, but the only problem is that when they insert a comment the user listed in the comment (ie.. "username:") is the same user no matter which users is logged in. The username listed happens to be the user name entered when the server  was first built.

Is there any way we can change things so that excel starts a comment off with the currently logged in user (Profile based), so that they can track who is making changes to the spreadsheets.

I hope that makes sense, but if not go into Excel right mouse click on a cell and click Insert Comment. You will then see the comment box appear and the username followed by a colon. it is the username that needs to be the same as the logged in user. Office 2007 has recently been installed and this didn't happen with 2003.

Software:
Windows 2003 Server SP 1
Microsoft Office Standard 2007
0
Comment
Question by:biggles70
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
akoster earned 500 total points
ID: 35034883
You can change the default comment name by the code
application.username = "yeddie yeddie"

Open in new window


To find out who is the active user, you could try out a number of options :

 - windows login name
Debug.Print Environ("USERNAME")

Open in new window


- activedirectory user name
Dim objAdSys, objUser
Set objAdSys = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objAdSys.UserName)
Debug.Print objUser.get("cn")
Debug.Print objUser.get("displayname")

Open in new window


- use windows API
first declare getusername function in the upper section of a vba module
Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Open in new window

below that, add following code in a subroutine
Dim strLen As Long
Dim strtmp As String * 256
Dim strUserName As String
strLen = 255
GetUserName strtmp, strLen
strUserName = Trim$(Replace(strtmp, Chr$(0), ""))
Debug.Print strUserName

Open in new window


pick one that suits your need and replace the "debug.print" for "application.username ="
0
 
LVL 19

Assisted Solution

by:akoster
akoster earned 500 total points
ID: 35034925
for an extensive overview of other possibilities in working with comments, you might want to have a look at

http://www.contextures.com/xlcomments03.html
0
 

Author Closing Comment

by:biggles70
ID: 35076534
Both responses were, or will be, good to know in time.

Unfortunately time was short and I advised users to do the following:

click on the Office button -> Excel options and change the name under popular - Personalize your copy of Microsoft Office.

Even when we removed the users profile, or got a new user to login, they were getting the name used from when the server was built. Users changed their name as above and it remains after they logout and back in.
0

Featured Post

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
using vb script 5 47
Macro that Locks & Unlocks Worksheet 4 25
any combination of this numbers 9 27
Count How Many Times Each Number Repeats 14 11
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
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 …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

679 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