Hi all,
I have been working on an Access 2010 DB importing files and massaging data to produce a final useful table.
As a start to the process, I need to download 5 different files from 3 password secured web sites. I am using TWebst to navigate IE 10 (as I am also running other data collection routines from other sites than the three mentioned above).
I have been struggling with the File Save As on the Download piece. Each file is created and sent to the borwser by a Server side Javascript program executed once the button is pressed. I do this with TWebst.
So I get to the point where IE presents the small window at the bottom of the browser with the Open / Save / Cancel buttons.
Adrian from Twebst suggested today I check out AutoIt as a workaround to the fact Twebst does not have the functionality to control the IE download window.
I have downloaded AutoIt and done some research, but I am still at a loss to understand how to integrate the two (I am a basic VBA programmer, so please be kind!).
I would like to know how to incorporate the AutoIt code in the VBA (rather than external exe/script). If it has to be an external exe/script then I need to feed to it the download path as a parameter to repeat its use for the other files.
I have registered the ActiveX "AutoItX3 1.0 Type Library" control in Tools/References within Acess VBA Editor.
Any suggestions / examples I can follow would be REALLY appreciated. Thanks in advance for any help you provide!
Here's the VBA routine for one of the download portals:
Private Sub DownloadDD() Set core = New TwebstLib.core Set browser = core.StartBrowserVba(urlDD) '* DD Log In Call browser.FindElementVba("input text", "id=panel-login-name").InputText(uidDD) Call browser.FindElementVba("input text", "id=panel-login-account").InputText(namDD) Call browser.FindElementVba("input password", "id=panel-login-password").InputText(pwdDD) Call browser.FindElementVba("a", "id=login-button").Click Set objCollection = browser.FindAllElementsVba("div", "id=panelLoggedIn") If objCollection.length > 0 Then Call browser.Navigate(catDD) ' Here's where I want to "Save file as" default file name and ConstSavePath (the path is a constant elsewhere in my code)' End If '* DD Log Out 'Call browser.Close End Sub