I wrote an VBA script in an Excel Macro. I basically collects data from the rows and posts it to a RESTful service. It works in all our machines except for one where nothing happens when we click on the buttons. There are no errors/messages of any kind. The code resides in the Microsoft Excel Objects(under corresponding sheets). I have copied the code gist below:
Const url As String = "https://xx.yy.com"
Const token As String = "aaaa"
Private Sub CommandButton1_Click()
LoadXX
End Sub
Function LoadXX()
Dim xChild1, xChild As MSXML2.IXMLDOMNode
Dim zipResult As New MSXML2.DOMDocument
Dim zipService As New MSXML2.XMLHttp
Randomize
random_number = Int(99999999 * Rnd) + 1
Query = url & "callService?sessionId=" & random_number
zipService.Open "GET", Query, False
zipService.setRequestHeader "X-Access-Token", token
On Error GoTo ThereWasBadConnection
zipService.send
zipResult.LoadXML (zipService.responseText)
End Function
I have done the usual steps such as:
- Choosing Enable all Macros in Trust Center settings
- Enabling Trust access to the VBA project object model in Trust center settings
- Choosing 'Run all from my Computer' in Control Panel -> Programs and Features -> Microsoft Office 2010
- Reinstalling Office 2010 a couple of times.
I have even got Admin rights on my machine. Please let me know if any further details are needed.
Help!
Edit
I have to say that this is my first coding experience in Excel macro(VBA). I have written my code inside corresponding sheets inside Microsoft Excel Objects(MEO). If I move it to Modules it works. In a lot of machines it(code inside MEO) still works fine. Why this behaviour?