Access web automation stopped working - field won't fill in

projecttoday

Registered User.
Local time
Today, 18:39
Joined
Jan 5, 2011
Messages
54
I have an Access db with code in it that downloads some files from a website. It's been working fine daily for many months.
One of the things the code has to do is sign in to the site. My VBA code fills in a user id and a password onto a web page. All of a sudden today, the fill-ins don't work. This is the user id code:

Code:
Forms.frmetfsstocksdownload.ebrETFsStocksDL.ExecuteJavascript "document.getElementById('user_login').value = '" & Forms.frmetfsstocksdownload.txtUserID & "'"

This sets the user id on the webpage with the value in my Access form in textbox txtUserID. This code is in a module, so we must use Forms.frmetfsstocksdownload instead of Me. It's been working. Why did it stop working? Any tips on finding out the cause? Or a work-around?
 
Does it still work interactively?
Web sites sometimes change. For example, 'user_login' may have been renamed. Inspect the web page's source code.
They could also have added protection against automatic logins.
 
I had thought of that, but I couldn't remember the command to display the HTML (which I'm not conversant in) for the page. And then I did. Right-click, display page source.
And, after scrolling through hundreds of lines, sure enough, I spotted 'cognito_user_email'. It looks like 'user_login' was changed to 'cognito_user_email'. And 'user_password' was changed to 'cognito_user_password'. Well! I guess that's one of the hazards of automating somebody else's website.
Solved.
Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom