+ Reply to Thread
Results 1 to 8 of 8

build a code with will check UK VAT numbers with a website

  1. #1
    Registered User
    Join Date
    01-23-2023
    Location
    England
    MS-Off Ver
    Windows 11
    Posts
    3

    build a code with will check UK VAT numbers with a website

    Hi

    I'm having a few issues and I'm hoping somebody can point me in the right direction. I just want to say I'm completely new at this so I will say sorry now

    I'm trying to build a code with will check UK VAT numbers with a website. I have managed to get the code to enter the VAT number and click the button but I'm struggling with getting the response with a message saying Valid or Invalid VAT number

    The code I am using is below

    Please Login or Register  to view this content.
    I think the Class Name I need is

    <h1 class="govuk-panel__title">
    Valid UK VAT number
    </h1>

    but it's showing a blank text box??

    Any help will be much appreciated
    Last edited by alansidman; 01-24-2023 at 07:05 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow re: build a code with will check UK VAT numbers with a website


    Hi, so why (1) : is there several elements with the same class name ?

    If yes allocate the class name collection to a variable object then
    in debug mode check within this variable which is the correct index of the expected element.

    As internally the first element has the index zero but in the Locals window where you check the variable the first item is shown as #1 …

  3. #3
    Forum Contributor
    Join Date
    02-25-2022
    Location
    Dallas, Texas
    MS-Off Ver
    Office 365
    Posts
    174

    re: build a code with will check UK VAT numbers with a website

    I wouldn't use Internet Explorer. It has been discontinued and most websites won't work with it. Look at using Selenium. How to setup

  4. #4
    Registered User
    Join Date
    01-23-2023
    Location
    England
    MS-Off Ver
    Windows 11
    Posts
    3

    re: build a code with will check UK VAT numbers with a website

    Hi

    Thanks for your reply

    I have changed it code to (0) but the box still comes back as empty

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow re: build a code with will check UK VAT numbers with a website


    So it's not the good element, see what contains the specific class name collection …

  6. #6
    Registered User
    Join Date
    01-23-2023
    Location
    England
    MS-Off Ver
    Windows 11
    Posts
    3

    re: build a code with will check UK VAT numbers with a website

    Just changed to Selenium

    I can't seem to pull the info from a tag name called h4

    Any idea how to read this string in a message box and also push it to a cell in Excel

    Any help is much appreciated

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    re: build a code with will check UK VAT numbers with a website

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. Since you are new to this forum, I have added them for you.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: build a code with will check UK VAT numbers with a website

    Hi. Forum Rule 1 is very short. It states: "Title must briefly summarize your request."

    A GOOD thread title is the sort of thing you would use as a search term on Google*. Your chosen title would produce a squillion useless hits. In future, please take a bit more time to think of a descriptive title that would be "Google-friendly". Many people search the forum answers looking for help and your very general title wouldn't help them at all.

    Since you are a new user of this site, on this occasion, I have changed it for you.

    However, if you continue to use weak titles, you can expect to have your thread BLOCKED until you change it yourself. If that happens, to edit the thread title, open the original post, click "Edit Post" (bottom right) to access the area where you can edit your title.

    *Other search engines are available!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA code to check for odd numbers only
    By chipp300 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-10-2020, 01:20 AM
  2. [SOLVED] vba code to check if cell has numbers, then message box and exit
    By chubbychub in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2018, 04:15 PM
  3. [SOLVED] VB Code to check the format of the numbers
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2016, 03:46 PM
  4. How to check if excel file is Checked Out in SharePoing Check Out, run code, Check In
    By jrtraylor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2016, 04:36 PM
  5. Excel VBA - check if website exists (NOT OPEN)
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-18-2015, 12:09 PM
  6. Vba code to check a number in a cell against numbers in a column
    By Buddy8 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-07-2014, 03:33 PM
  7. Check the price order in a website
    By angel111 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2013, 08:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1