MarcusL Posted July 4, 2013 Share Posted July 4, 2013 (edited) 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 Edited July 4, 2013 by MarcusL Link to comment Share on other sites More sharing options...
MarcusL Posted July 5, 2013 Author Share Posted July 5, 2013 Guys, a hint or some direction would be really appreciated. I am just struggling to bring the two tools together. Thanks for any advice. Link to comment Share on other sites More sharing options...
MarcusL Posted July 12, 2013 Author Share Posted July 12, 2013 Thanks all for the overwhelming help and support. Link to comment Share on other sites More sharing options...
0xdefea7 Posted July 13, 2013 Share Posted July 13, 2013 You can do this all in AutoIt if you want, just change your VBA routine to run your script instead. Check out the IE.au3 functions, the script will look pretty similar to what you already have in VBA as far as layout goes. Since it is javascript, you will likely need to automate clicks on the screen, so that you can click the dialog and save your file. As far as taking command lines, that is just this variable in your script: $CmdLine[1] ; first arg $CmdLine[2] ; second arg ;etc I might have a better answer for you in a few hours after I get home from work, but I have a busy weekend ahead so I may run out of time. Hopefully this helps to point you in the right direction. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 13, 2013 Moderators Share Posted July 13, 2013 MarcusL, Thanks all for the overwhelming help and supportRemember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. Be patient and someone will answer. Or if not - tough! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now