View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
scubaguy_357 scubaguy_357 is offline
external usenet poster
 
Posts: 1
Default Office XP compatiblity- Signed in user

The following function worked fine in my previous version of Excel but does
not work in XP. It tries to retrieve the logged in user. Thanks for the help!

Private Declare Function GetUserName Lib "advapi32.dll"_
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize as Long)_
As Long

Funtion UserName() As String
Dim Buffer as String * 100
Dim BuffLen as Long
BuffLen=100
GetUserName Buffer, BuffLen
UserName= Left(Buffer, BuffLen - 1)
End Function
'The error I get is "Compile error- can't find project or library"

Thanks for any help you can give.