My overall goal is to login to a website and download a specific link located on that page -- all of this through a VBA macro.
However, with this particular website, I cannot even view the source code of the page to look at the username/password variables, as was recommended here: http://www.exceltrainingvideos.com/how-to-login-automatically-into-website-using-excel-vba/
This is what the webpage looks like:
I am not able to view the source code because as you can see, I see nothing back from the server until authenticated.
I have functional code to open up the browser. Just not to login.
Sub OpenInFireFoxNewTab(url As String)
Dim pathFireFox As String
'
pathFireFox = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
If Dir(pathFireFox) = "" Then pathFireFox = "C:\Program Files\Mozilla Firefox\firefox.exe"
If Dir(pathFireFox) = "" Then
MsgBox "FireFox Path Not Found", vbCritical, "Macro Ending"
Exit Sub
End If
Shell """" & pathFireFox & """" & " -new-tab " & url, vbHide
' use sendKeys to send an enter acceptance
Application.SendKeys "~", True
End Sub
I am using Mozilla because our server doesnt have an https security certificate (which came up on IE), so Mozilla was a work around.
How can I still login using VBA?
EDIT: It opens up the page, asks do you want to confirm login (prompts for pressing OK), but then never sends the OK command. Im trying to currently debug and familiarize myself with this VBA debugger.
EDIT #2: Changed sendkeys to just send a "~" with no variable. Now its moving down one row in the excel sheet, instead of pressing enter on the Mozilla window.