Ashe
New Member
- Joined
- Dec 2, 2023
- Messages
- 9
- Office Version
- 2021
- Platform
- Windows
I'm not 100% sure how to describe this error as I'm not familiar with WinHTTP, so please bear with me!
This Excel file runs on my computer, but it runs for no one else. My coworkers have the same system, same version of Excel, macros are enabled, the properties in VBA are all the same, and this file has supposedly been "broken" for months, before I came to this department. My coworker gave it to me on a whim to see if I could fix it. I ran the document to see what it does and it worked perfectly fine, which has left everyone stumped. Based on my observations, everyone is getting the same error result, shown below:
I was also told that the person who coded this document wasn't the best at it, but as I'm learning as I go, I have no idea if anything is redundant or erroneous in this code.
Here's the raw code from the image:
If need be I can provide more of the code! That's just the piece that the Debug flags.
Thank you in advance for your help!
This Excel file runs on my computer, but it runs for no one else. My coworkers have the same system, same version of Excel, macros are enabled, the properties in VBA are all the same, and this file has supposedly been "broken" for months, before I came to this department. My coworker gave it to me on a whim to see if I could fix it. I ran the document to see what it does and it worked perfectly fine, which has left everyone stumped. Based on my observations, everyone is getting the same error result, shown below:
I was also told that the person who coded this document wasn't the best at it, but as I'm learning as I go, I have no idea if anything is redundant or erroneous in this code.
Here's the raw code from the image:
VBA Code:
Function userInfo(h As Object, username$) As String
'Used to pull information about a user such as badge # and employee ID
h.SetAutoLogonPolicy 0
h.SetTimeouts 0, 0, 0, 0
h.Open "GET", "website" & username$
h.send
h.waitforresponse
userInfo = h.responseText
End Function
If need be I can provide more of the code! That's just the piece that the Debug flags.
Thank you in advance for your help!