Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Is there anyway to retrieve Registry Values from VBA???

I'm not sure if this is possible but I am trying to retieve my FULL
Name rather than my logon name from my PC. I was thinking of doing
this through the registry but I'm not sure if this is the best way.
Please help someone, I'm slowly going crazy!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Is there anyway to retrieve Registry Values from VBA???

It's not in the registry is it?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"FunkySquid" wrote in message
ups.com...
I'm not sure if this is possible but I am trying to retieve my FULL
Name rather than my logon name from my PC. I was thinking of doing
this through the registry but I'm not sure if this is the best way.
Please help someone, I'm slowly going crazy!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Is there anyway to retrieve Registry Values from VBA???

Well I've searched for my full name in the registry and it shows up in
the following string:

HKEY_CURRENT_USER\Software\Inifiles\User Profile.ini\User Profile

"UserName" = "MyFullName"

Is there a way of retrieving this by using VBA or is there another way
to retrieve MyFullName from my computer?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default Is there anyway to retrieve Registry Values from VBA???

Is it the Computer Name that you are after? If so:
Environ("computername")

FunkySquid wrote:
Well I've searched for my full name in the registry and it shows up in
the following string:

HKEY_CURRENT_USER\Software\Inifiles\User Profile.ini\User Profile

"UserName" = "MyFullName"

Is there a way of retrieving this by using VBA or is there another way
to retrieve MyFullName from my computer?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Is there anyway to retrieve Registry Values from VBA???

Do you have Administrator priviledges and are you on home or company
workstation? Also are you looking for VBA code to find the name or are you
looking for a way to modify the Registry?

"FunkySquid" wrote:

I'm not sure if this is possible but I am trying to retieve my FULL
Name rather than my logon name from my PC. I was thinking of doing
this through the registry but I'm not sure if this is the best way.
Please help someone, I'm slowly going crazy!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Is there anyway to retrieve Registry Values from VBA???

I think that will be because of some software that you have installed, I
don't have such a key on my machine.

The problem with any such value is that it relies on the user supplying that
info on some install, something which I wouldn't rely upon.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"FunkySquid" wrote in message
ups.com...
Well I've searched for my full name in the registry and it shows up in
the following string:

HKEY_CURRENT_USER\Software\Inifiles\User Profile.ini\User Profile

"UserName" = "MyFullName"

Is there a way of retrieving this by using VBA or is there another way
to retrieve MyFullName from my computer?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Is there anyway to retrieve Registry Values from VBA???

"FunkySquid" wrote:

Well I've searched for my full name in the registry and it shows up in
the following string:

HKEY_CURRENT_USER\Software\Inifiles\User Profile.ini\User Profile

"UserName" = "MyFullName"

Is there a way of retrieving this by using VBA or is there another way
to retrieve MyFullName from my computer?



If you need full name of a user account, you can use WinNT provider:

Sub WinNTtest()

Set objNetwork = CreateObject _
("Wscript.Network")

strComputer = objNetwork.ComputerName
'strUser = objNetwork.UserName
strUser = "baba"

Set objUser = GetObject("WinNT://" & _
strComputer & "/" & strUser & ", user")

Debug.Print objUser.get("FullName")

End Sub

If you want full name of a currently logged on user you can use strUser =
objNetwork.UserName to get user's name.

You can also use WMI service:

Sub WMItest()

strUser = "baba"

Set objWMIService = GetObject _
("WinMgmts:root\cimv2")

Set colUsers = objWMIService.ExecQuery _
("Select * From Win32_UserAccount " & _
"Where Name='" & strUser & "'")

For Each objUser In colUsers
Debug.Print objUser.FullName
Next

End Sub


If the user is in a domain you would use LDAP, but I don't have much
experience with that.

--
urkec
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using VBA to retrieve values to ComboBox Serene Excel Discussion (Misc queries) 0 March 19th 10 02:21 AM
Retrieve Error Bar Values Spiggy Topes Charts and Charting in Excel 3 February 23rd 09 06:42 PM
Storing important values: ini file, XML, Registry, where else ? syswizard Excel Programming 4 March 8th 07 10:14 PM
Setting binary values in Registry? Don Wiss Excel Programming 1 August 17th 06 02:38 AM
Retrieve values from 2 worksheets. [email protected] Excel Worksheet Functions 3 May 24th 06 08:16 PM


All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"