Guest User

Untitled

a guest
Jan 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. onclick="ga('send', 'event', 'Downloads', 'XLS', 'https://www.england.nhs.uk/statistics/wp-content/uploads/sites/2/2018/01/LA-Type-B-November-2017-2ayZP.xls');"
  2.  
  3. Option Explicit
  4.  
  5. Public Sub DownloadDTOC()
  6.  
  7. Dim http As New XMLHTTP60
  8. Dim html As New HTMLDocument
  9. Dim CurrentWindow As HTMLWindowProxy
  10.  
  11. With http
  12. .Open "GET", "https://www.england.nhs.uk/statistics/statistical-work-areas/delayed-transfers-of-care/delayed-transfers-of-care-data-2017-18/", False
  13. .send
  14. html.body.innerHTML = .responseText
  15. End With
  16.  
  17. On Error GoTo Errhand
  18.  
  19. 'Call html.parentWindow.execScript("ga('send', 'event', 'Downloads', 'XLS', 'https://www.england.nhs.uk/statistics/wp-content/uploads/sites/2/2018/01/LA-Type-B-November-2017-2ayZP.xls');", "Javascript") '-2147352319 Automation error
  20.  
  21. 'Call html.frames(0).execScript("ga('send', 'event', 'Downloads', 'XLS', 'https://www.england.nhs.uk/statistics/wp-content/uploads/sites/2/2018/01/LA-Type-B-November-2017-2ayZP.xls');", "Javascript") '438 Object doesn't support this property or method
  22. 'automation error
  23.  
  24. 'Call currentWindow.execScript("ga('send', 'event', 'Downloads', 'XLS', 'https://www.england.nhs.uk/statistics/wp-content/uploads/sites/2/2018/01/LA-Type-B-November-2017-2ayZP.xls');", "Javascript") ' 91 Object variable or With block variable not set
  25.  
  26. Set CurrentWindow = html.parentWindow
  27. Call CurrentWindow.execScript("ga('send', 'event', 'Downloads', 'XLS', 'https://www.england.nhs.uk/statistics/wp-content/uploads/sites/2/2018/01/LA-Type-B-November-2017-2ayZP.xls');", "Javascript") '--2147352319 Could not complete the operation due to error 80020101.
  28.  
  29. Exit Sub
  30.  
  31. Errhand:
  32. If Err.Number <> 0 Then Debug.Print Err.Number, Err.Description
  33. End Sub
Add Comment
Please, Sign In to add comment