• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Web Scraping – Filling in Forms|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Web Scraping – Filling in Forms|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosWeb Scraping – Filling in Forms
sp_PrintTopic sp_TopicIcon
Web Scraping – Filling in Forms
Avatar
Amit Shah

New Member
Members
Level 0
Forum Posts: 2
Member Since:
April 14, 2020
sp_UserOfflineSmall Offline
1
April 14, 2020 - 6:49 pm
sp_Permalink sp_Print sp_EditHistory
Error.PNGImage Enlarger
I have used SeleniumBasic-2.0.9.0.exe and Latest stable release: ChromeDriver 81.0.4044.69
I'm trying to scrape "Name" data from this website "http://ec.europa.eu/taxation_c.....toms/vies/", I chose a Member State from the dropdown, so 'GB-United Kingdom' in this instance. Then enter the VAT Number(Let's say - "

238554836

", and click on Verify.

The issue i'm getting in my code is the

runtime error -2146232576 automation error

in the 5th line of the Code(

While

 Statement)

Sub formfill() Dim Driver As New Selenium.ChromeDriver Dim count As Long Sheets("DATA").Activate Set Driver = CreateObject("Selenium.ChromeDriver") // Here is the Error poping up count = 1 While (Len(Range("A" & Count)) > 0) Driver.Get "http://ec.europa.eu/taxation_c....." Driver.FindElementById("countryCombobox").SendKeys "GB" Driver.FindElementById("number").SendKeys Range("A" & Count) Driver.FindElementById("submit").Click Range("B" & Count)Driver.FindElementByXPath("//table/tbody/tr[6]/td[2]").Text count = count + 1 Wend Driver.Quit End Sub

Though i have performed all the tasks of installing Selenium , also installed the Chrome Driver too, then the references too in the VBA editor. But other system just cant go past Automation Error.

sp_PlupAttachments Attachments
  • sp_PlupImage Error.PNG (197 KB)
sp_AnswersTopicSeeAnswer See Answer
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1510
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
April 14, 2020 - 7:16 pm
sp_Permalink sp_Print

Hi Amit,

The code in the workbook and the code in your image are not the same.  I can run the code in the workbook you attached without issue.

As I said in my reply to you on the blog post - in the code in your image, you have not declared or initialized the variable count so when you try to evaluate it in the statement

While (Len(Range("A" & count)) > 0)

You get that error.

Phil

Avatar
Amit Shah

New Member
Members
Level 0
Forum Posts: 2
Member Since:
April 14, 2020
sp_UserOfflineSmall Offline
3
April 15, 2020 - 2:18 am
sp_Permalink sp_Print

Hi Phil,

Sorry the wrong image got attached.
But the code which is perfect ran in one system.
But doesn't run in the other.
It says,  "runtime error -2146232576 automation error" in this "Set Driver = CreateObject("Selenium.ChromeDriver")" line of code.

This is the main issue now.NewError.PNGImage Enlarger

Please have a look into this.

Thanks 
Amit

sp_PlupAttachments Attachments
  • sp_PlupImage NewError.PNG (137 KB)
Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1510
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
4
April 15, 2020 - 9:56 am
sp_Permalink sp_Print sp_EditHistory

Hi Amit,

Without being at the PC in question hard to say.  You say the code works on another machine so the issue isn't the code.

Things I'd check:

- Is Chrome installed and working?

- Do the installed versions of Chrome and ChromeDriver match?  Note that as mentioned here https://www.myonlinetraininghu.....ling-forms they must match

Regards

Phil

sp_AnswersTopicAnswer
Answers Post
sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Dieneba NDIAYE, Ben Hughes, Dario Serrati, Jay Soysa, Marco Marques, Christopher Anderson, Natasha Smith, dectator mang, Oluwadamilola Ogun, yashal minahil
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
yashal minahil
Oluwadamilola Ogun
Yannik H
dectator mang
Francis Drouillard
Orlando Inocente
Jovitha Clemence
Maloxat Axmatovna
Ricardo Freitas
Marko Meglic
Forum Stats:
Groups: 3
Forums: 24
Topics: 6200
Posts: 27181

 

Member Stats:
Guest Posters: 49
Members: 31858
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.