Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserName Function: Not Working
I used this little trick in the office for a few recent projects:
http://www.j-walk.com/ss/excel/tips/tip94.htm It works perfectly fine on the machines in the office, with the exception of one machine. As far as I can tell, we have all the MS critical updates for this machine. I found the advapi32.dll on the problem-machine too. I can't figure out what it is. Any thoughts or suggestions? Regards, Ryan-- -- RyGuy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserName Function: Not Working
Hi,
What do you mean by it doesn't work: - returns the wrong username - an error pops up - ... -- Regards, Sébastien <http://www.ondemandanalysis.com "ryguy7272" wrote: I used this little trick in the office for a few recent projects: http://www.j-walk.com/ss/excel/tips/tip94.htm It works perfectly fine on the machines in the office, with the exception of one machine. As far as I can tell, we have all the MS critical updates for this machine. I found the advapi32.dll on the problem-machine too. I can't figure out what it is. Any thoughts or suggestions? Regards, Ryan-- -- RyGuy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserName Function: Not Working
Oh yes, sorry, an error message pops up.
Any thoughts on what may cause this? -- RyGuy "sebastienm" wrote: Hi, What do you mean by it doesn't work: - returns the wrong username - an error pops up - ... -- Regards, Sébastien <http://www.ondemandanalysis.com "ryguy7272" wrote: I used this little trick in the office for a few recent projects: http://www.j-walk.com/ss/excel/tips/tip94.htm It works perfectly fine on the machines in the office, with the exception of one machine. As far as I can tell, we have all the MS critical updates for this machine. I found the advapi32.dll on the problem-machine too. I can't figure out what it is. Any thoughts or suggestions? Regards, Ryan-- -- RyGuy |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserName Function: Not Working
What error message?
We're not clairvoyant, you see........ -- Kind regards, Niek Otten Microsoft MVP - Excel "ryguy7272" wrote in message ... | Oh yes, sorry, an error message pops up. | Any thoughts on what may cause this? | | -- | RyGuy | | | "sebastienm" wrote: | | Hi, | What do you mean by it doesn't work: | - returns the wrong username | - an error pops up | - ... | -- | Regards, | Sébastien | <http://www.ondemandanalysis.com | | | "ryguy7272" wrote: | | I used this little trick in the office for a few recent projects: | http://www.j-walk.com/ss/excel/tips/tip94.htm | | It works perfectly fine on the machines in the office, with the exception of | one machine. As far as I can tell, we have all the MS critical updates for | this machine. I found the advapi32.dll on the problem-machine too. I can't | figure out what it is. Any thoughts or suggestions? | | Regards, | Ryan-- | | | -- | RyGuy |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserName Function: Not Working
Whoops, sorry again.; very tired now. I think the error says:
#NAME I'm not at that workstation to test it now. I was thinking it may be a corrupt dll file. Is that possible? Could the 'advapi32.dll' gotten corrupted and caused JWalk's function to create this error? Doesn't XP just rebuild these types of corrupted dll files? I've been using VBA for a couple of years and I haven't run into this before. I'm baffled. Any insight would be appreciated. -- RyGuy "Niek Otten" wrote: What error message? We're not clairvoyant, you see........ -- Kind regards, Niek Otten Microsoft MVP - Excel "ryguy7272" wrote in message ... | Oh yes, sorry, an error message pops up. | Any thoughts on what may cause this? | | -- | RyGuy | | | "sebastienm" wrote: | | Hi, | What do you mean by it doesn't work: | - returns the wrong username | - an error pops up | - ... | -- | Regards, | Sébastien | <http://www.ondemandanalysis.com | | | "ryguy7272" wrote: | | I used this little trick in the office for a few recent projects: | http://www.j-walk.com/ss/excel/tips/tip94.htm | | It works perfectly fine on the machines in the office, with the exception of | one machine. As far as I can tell, we have all the MS critical updates for | this machine. I found the advapi32.dll on the problem-machine too. I can't | figure out what it is. Any thoughts or suggestions? | | Regards, | Ryan-- | | | -- | RyGuy |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserName Function: Not Working
What error message?
In the meantime, you may want to try this implementation, found on vbcode.com: Public Function GetLoggedInUserName() as string Dim cn As String dim Name as String Dim ls As Long Dim res As Long cn = String(1024, 0) ls = 1024 res = GetUserName(cn, ls) If res < 0 Then name = Mid(cn, 1, InStr(cn, Chr(0)) - 1) Else name = "" End If GetLoggedInUserName = Name End function -- Regards, Sébastien <http://www.ondemandanalysis.com "ryguy7272" wrote: Oh yes, sorry, an error message pops up. Any thoughts on what may cause this? -- RyGuy "sebastienm" wrote: Hi, What do you mean by it doesn't work: - returns the wrong username - an error pops up - ... -- Regards, Sébastien <http://www.ondemandanalysis.com "ryguy7272" wrote: I used this little trick in the office for a few recent projects: http://www.j-walk.com/ss/excel/tips/tip94.htm It works perfectly fine on the machines in the office, with the exception of one machine. As far as I can tell, we have all the MS critical updates for this machine. I found the advapi32.dll on the problem-machine too. I can't figure out what it is. Any thoughts or suggestions? Regards, Ryan-- -- RyGuy |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserName Function: Not Working
Thanks for taking a crack at it everyone. Still unsure what the problem is,
but I am going to use a different technique altogether. Regards, Ryan-- -- RyGuy "sebastienm" wrote: What error message? In the meantime, you may want to try this implementation, found on vbcode.com: Public Function GetLoggedInUserName() as string Dim cn As String dim Name as String Dim ls As Long Dim res As Long cn = String(1024, 0) ls = 1024 res = GetUserName(cn, ls) If res < 0 Then name = Mid(cn, 1, InStr(cn, Chr(0)) - 1) Else name = "" End If GetLoggedInUserName = Name End function -- Regards, Sébastien <http://www.ondemandanalysis.com "ryguy7272" wrote: Oh yes, sorry, an error message pops up. Any thoughts on what may cause this? -- RyGuy "sebastienm" wrote: Hi, What do you mean by it doesn't work: - returns the wrong username - an error pops up - ... -- Regards, Sébastien <http://www.ondemandanalysis.com "ryguy7272" wrote: I used this little trick in the office for a few recent projects: http://www.j-walk.com/ss/excel/tips/tip94.htm It works perfectly fine on the machines in the office, with the exception of one machine. As far as I can tell, we have all the MS critical updates for this machine. I found the advapi32.dll on the problem-machine too. I can't figure out what it is. Any thoughts or suggestions? Regards, Ryan-- -- RyGuy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
ISBLANK function not working when cell is blank dut to function re | Excel Discussion (Misc queries) | |||
What is the function for system to capture the username | Excel Discussion (Misc queries) | |||
Function to display username/networkname | Excel Programming | |||
Newly created Get Function is not working when I copied the syntax from a working function | Excel Programming | |||
Working with Arrays, pasing from function to function | Excel Programming |