ProfessorT
IS-IT--Management
I am trying to retrieve the Logon_User information from the ServerVariable in the Request object. I can do this in ASP without any problems. However, when I attempt this in an Excel macro, I get the run-time error 91 - object not set or with block variable not set. I even created an UDF dll to return the logon user name. Again, this works in ASP but, not in the macro. Can the request.servervariable be used in VBA in an excel macro? Or is it only for use in ASP?
My code looks like this:
Dim objGetName As TestName.GetUserName
Set objGetName = New TestName.GetUserName
myUserName = objGetName.GetLoginName <-- Error Occurs Here
MsgBox (myUserName)
If I use the code below, I also get an error.
Dim objGetName As Object
Set objGetName = CreateObject("TestName.GetUserName")
myUserName = objGetName.GetLoginName <-- Error Occurs Here
MsgBox (myUserName)
Could someone please tell me what is wrong? The syntax is correct as far as I can tell.
Thanks.
My code looks like this:
Dim objGetName As TestName.GetUserName
Set objGetName = New TestName.GetUserName
myUserName = objGetName.GetLoginName <-- Error Occurs Here
MsgBox (myUserName)
If I use the code below, I also get an error.
Dim objGetName As Object
Set objGetName = CreateObject("TestName.GetUserName")
myUserName = objGetName.GetLoginName <-- Error Occurs Here
MsgBox (myUserName)
Could someone please tell me what is wrong? The syntax is correct as far as I can tell.
Thanks.