If anyone has any ideas that would be great! I have pasted my code below: Dim driver As New Selenium.WebDriverĭriver.Get " company=Arrow&username=A79123"ĭriver.Get "file:///C:/Users/a79123/Downloads/report_Hires_by_Job_Family_Sarah_07a6559d-98a8-436d-b686-5abd2a2c631d. Private Sub Test () Dim strFile As String Dim. The second one which was also mentioned be yourself. And this is the code to download the file: Code: Select all. A macro to do this would appear as follows: Sub DoBrowse1 () Dim ie As Object Set ie CreateObject ('Internetexplorer.Application') ie.Visible True ie.Navigate 'c:\temp\MyHTMLfile.htm' End Sub This macro will open the file c:\temp\MyHTMLfile.htm in a new Internet Explorer window. I found over the years more ways how to save/download data using vba: The firs option witch I prefer and would recommend is to use the URLDownloadToFile function of the user32 library using the following solution. I can get the macro to pull a pdf, associated with a URL, but it wont grab an ad hoc excel report. Private Declare Function URLDownloadToFile Lib 'urlmon' Alias 'URLDownloadToFileA' (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long. Once you’ve done that, in a new module, enter the following VBA function. Its exact location may differ on your computer. Also, when I run this I only get a dialog box with an "X" and nothing else. The first thing you’ll need to do is set a reference to the Microsoft XML parser library in the Excel Visual Basic Editor (VBE): You should find the Microsoft XML library in the list of References. But, is it a possibility to pull data from a secure website (one that requires login) to automate a report? The link provided was close, but I dont understand how to pass the parameters in. I have code to pull general data from a website into excel using a macro, e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |