HTML Macro to print documents

ExcelNooberino

New Member
Joined
Jan 2, 2019
Messages
43
Office Version
  1. 2016
Platform
  1. 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
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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