VBA code that selects an option from a list on a web page

tjodell1995

New Member
Joined
Feb 22, 2021
Messages
2
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Okay so this might be a tricky one, but I am trying to make a macro that opens up the browser(Chrome), navigates to our company's secured web page(will obviously need to enter username and password), and then selects a wave number from a list of wave numbers that updates as new waves are released. My idea is to have a button in the excel spreadsheet next to a cell where you insert a wave number. Then, have it navigate to the page with the selection list, and select the wave number from the list, select the finish button so it proceeds to the table with the data I need, and then exporting it as an excel spreadsheet so I can extract the data and place it in the 'live' table on the tool I am creating in excel. The idea is to make the button a 'refresh' button so any time you click it, it runs the macro to perform an update to the data table.

Now I am unable to access the site outside of the company network, so I'll be working on it at work, but I could really use a shell to go off of for the VBA coding, as I am still fairly new to it.
 

Attachments

  • SnipImage (1).JPG
    SnipImage (1).JPG
    26.7 KB · Views: 7
  • SnipImage.JPG
    SnipImage.JPG
    203.8 KB · Views: 8
  • Capture.PNG
    Capture.PNG
    71.7 KB · Views: 8

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Dan_W

Active Member
Joined
Jul 11, 2018
Messages
435
Office Version
  1. 365
Platform
  1. Windows
Hi - so here are my two cents. There are quite a few steps here, but I suppose (one of) the first issues is: can you only access this in Chrome? More to the point, can you not access in Internet Explorer? VBA can interact and control Internet Explorer; but it requires additional software to be installed in order to use Chrome called "Selenium" and you will also need to download the relevant ChromeDriver.

Without seeing the underlying code of the sites, it is difficult to suggest alternative workarounds. For example, could PowerQuery be a feasible workaround? I have only a passing familiarity with PQ, but I suspect it might give up at the first "select wave" listbox stage. I might be wrong, so perhaps someone with some PQ experience/knowledge would be able to give some guidance?

If Chrome is required, and you can't install software on the computer, then you might want to check out Autohotkey. I know that someone has come up with a non-Selenium based approach to interfacing with Chrome and I think Autohotkey can be run off a USB (i.e., no-installation) - that said, if your IT policy forbids you from installing anything, I can't imagine that they'd be comfortable with you running executables off a USB (and I think I heard that Autohotkey has a tendency of triggering every anti-virus program under the sun).
 

diddi

Well-known Member
Joined
May 20, 2004
Messages
3,301
Office Version
  1. 2010
Platform
  1. Windows
There is a reasonable possibility of using XMLHTTP within excel without installing any other software and without having to use chrome or IE
 

Watch MrExcel Video

Forum statistics

Threads
1,129,995
Messages
5,639,446
Members
417,090
Latest member
schoelleya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top