vendredi 2 juillet 2021

Search website using Excel data in column B; Save search results in column C and D

I will preface this by saying what I am asking is (almost) identical to this post: Search a website with Excel data to extract results and then loop

The only difference is that I'd also like to retrieve the 'Main Business Location'.

QHarr has provided a solution to retrieving just the Entity Type which I tried to follow, but unfortunately I am not familiar with VBA at all, and so I must have done something wrong in following his/her steps as my VBA popped out an error instead. I would love to ask him/her directly but I don't have enough reputation :(

My data is in "Sheet1".

Here is the first two rows of what sits in Sheet1

Here are the steps I followed.

  1. Alt + F11
  2. Tools > References > tick Microsoft HTML Object Library > OK
  3. Insert Class Module
  4. Copy paste QHarr's class clsHTTP's code
  5. Insert Module
  6. Copy paste QHarr's Standard module's code
  7. Run

An error pops out, saying "Compile error: User defined type not defined", and highlights the code "http As clsHTTP" and the "Public Sub GetInfo()" is highlighted in yellow, like so.

My two questions are:

  1. What have I done wrong?
  2. How can I also retrieve the Main Business Location?

Thank you all.




Aucun commentaire:

Enregistrer un commentaire