I have a code that pulls down table data from urls.
There I need to make vba to perform a clik action (to unhide last table), which gives back expected result only in debug mode.
Set objCollection = html.getElementsByClassName("{a keyword is entered here}")
objCollection(0).Click
If I simply run the code, it seems like click action was not performed.
If I stop code run right after click command and then let the code again to run, then I get back the expected result.
I have tried many things:
- DoEvents
- separate sub ("Refresh_All_Data_Connections") advised in some other topic
where issue was similar
Can somebody help to find the missing code part?
Try to make a test with code below may help you to solve your issue.
You need to change the URL and button ID in above code. Further you can modify the code as per your requirements.
Also check that scripts are already allowed and IE not showing any prompt to allow it. It can suppress the click.