Compile Error - VBA

borski88

Board Regular
Joined
Jul 3, 2015
Messages
71
Code:
Function pullDataSingleURL(URL As String, ws As Worksheet)
    [COLOR=#ff0000]Dim httpRequest As XMLHTTP      'XML V6.0[/COLOR]
    Dim DataObj As New MSForms.DataObject   'Forms 2.0
                                                
    Set httpRequest = New XMLHTTP
    httpRequest.Open "GET", URL, False
    httpRequest.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    httpRequest.send ""
    
    DataObj.SetText httpRequest.responseText
    DataObj.PutInClipboard
    
    DoEvents
    
    With ws
        .Activate
        .Cells.Clear
        .Cells(1, 1).Select
        .PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
    End With
End Function

This code works fine on my computer and a co-workers computer, but it breaks at the highlighted red line when its run by our boss. figures, right?

The following references are enabled:
http://imgur.com/izV45Eo
 
Last edited:

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I cannot see your link due to restrictions from personal storage on the PC I am at. At least for me, the 'Available References' window displays "Microsoft XML, v6.0" with a location of C:\Windows\System32\msxml6.dll. On your boss's PC, can you locate this dll? (Regardless of folder location)
 
Upvote 0
I sent the wrong image originally:

p3X5raC.png


n7yRFdf.png
 
Upvote 0
I cannot see your link due to restrictions from personal storage on the PC I am at. At least for me, the 'Available References' window displays "Microsoft XML, v6.0" with a location of C:\Windows\System32\msxml6.dll. On your boss's PC, can you locate this dll? (Regardless of folder location)

Yes, that is enabled on my bosses PC.
 
Upvote 0
yes, he has windows 10, I have windows 7.
is it possible to have the file able to run regardless of the OS?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,988
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top