ExcelNooberino
New Member
- Joined
- Jan 2, 2019
- Messages
- 43
- Office Version
- 2016
- Platform
- Windows
Hello everyone! So I've come up with the idea of trying to create a macro that allows me to open a few PDF documents from a intranet website here in the company I'm currently working in. The code below is what I have so far, and it's working perfectly but, I need to sort the table by one of the columns and I'm stuck in this part... I think it's because the sorting "button" doesn't have an ID like the other buttons, it's more like a href code with javascript and I was wondering if it's still possible to do it anyways... Thanks in advance!
Declare Function apiIEsize Lib "user32" Alias "ShowWindow" _ (ByVal hwnd As Long, ByVal CmdShow As Long) As Long
Global Const SW_MAXIMIZE = 3
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Sub IExplorerManifest()
Dim IExplorer As Object
Dim HTMLdoc As HTMLDocument
Dim downloadLink As HTMLLinkElement
Set ie = New InternetExplorerMedium
With ie
.Visible = True
apiIEsize ie.hwnd, 3
.navigate "https://e-lisa.app.corp/Default.aspx"
Application.Wait Now + TimeValue("00:00:02")
.navigate "https://e-lisa.app.corp/ManifestReport.aspx"
'Application.Wait Now + TimeValue("00:00:02")
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.GetElementByID("ctl00_ContentPlaceHolder1_ddlCustomer").Value = "926"
.document.forms(0).submit
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.GetElementByID("ctl00_ContentPlaceHolder1_ddlSupplier").Value = ""
.document.forms(0).submit
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.GetElementByID("ctl00_ContentPlaceHolder1_chooserStartDate_input").Value = Sheets("Sheet1").Range("A1").Text
.document.GetElementByID("ctl00_ContentPlaceHolder1_chooserStartDate_input").Focus
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.GetElementByID("ctl00_ContentPlaceHolder1_chooserEndDate_input").Value = Sheets("Sheet1").Range("B1").Text
.document.GetElementByID("ctl00_ContentPlaceHolder1_chooserEndDate_input").Focus
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.GetElementByID("ctl00_ContentPlaceHolder1_btnFilter").Focus
.document.GetElementByID("ctl00_ContentPlaceHolder1_btnFilter").Click
While .Busy Or .ReadyState <> 4: DoEvents: Wend
.document.GetElementByID("ctl00_ContentPlaceHolder1_gridViewManifestList_ctl01_checkBoxAll").Focus
.document.GetElementByID("ctl00_ContentPlaceHolder1_gridViewManifestList_ctl01_checkBoxAll").Click
End With
End Sub