Questions tagged [vba]

Visual Basic for Applications (VBA) serves as an event-based, object-oriented programming language designed exclusively for creating macros across the Office suite and various other applications. It is crucial to note that VBA should not be confused with VB.NET or VBS. In case you are utilizing Visual Studio, it is recommended to utilize [vb.net]. Furthermore, if your query pertains to programming within any MS Office application, please add the relevant tag such as [excel], [ms-access], [ms-word], [outlook], [visio], or [ms-project].

Interact with Excel-VBA drop down button using IE (SPAN NG-IF) in an AngularJS application

Is it possible to make a button click work with the SPAN NG-IF feature? Am I approaching this issue incorrectly? The name "Lõuna port" changes when something else is clicked in the drop-down menu. I have a list of all the names but can't figure out how ...

Delivering Access data in HTML format via email

In my MS Access database, I have a report that combines client records from one table (including email addresses) with grouped records fetched from other tables using a Query. I want to send this report directly to each client via email, within the body o ...

Using VBA with Selenium and Chromedriver to download and store PDF files

Here is a link to a PDF file that opens in Chrome: PDF file. Is there a way to save this PDF file directly from this page? I am running chrome with the following settings: driver.SetPreference "download.default_directory", "c:\chr" ...

Investigating the Retrieval of a Variant/Object/JScriptTypeInfo Attribute in VBA

I'm currently dealing with VBA code in an Excel module that looks like this: Function getDescription(ByVal pCode As String) As String Dim oRequest As Object Set oRequest = CreateObject("WinHttp.WinHttpRequest.5.1") oRequest.Open "GET", "https: ...

Change the range into a JSON array

How can I create a custom function in Excel VBA to convert a range into a JSON array? Currently, I only have the function signature: Function to_json(input As Range) End Function I need the input to be converted into a JSON array with the following stru ...

What is the best way to manipulate HTML elements with Selenium VBA and insert text into them?

I've been encountering difficulties when attempting to reference a search box on a website using Selenium in VBA. The search box's HTML code is as follows: <input type = "search" class ="form-control input-sm" placeholder aria-controls="resul ...

VBA combined with Selenium does not provide the capability to determine the size of an object/element

I'm encountering a frustrating issue with my Selenium setup. Currently, I am using VBA along with Selenium to verify the presence of an element on a webpage. My approach involves locating the element and then checking its size. If the size is 0, it indic ...

Guide on extracting a value from Excel and integrating it into the Path

I need help with a VBA/Selenium script that will allow me to extract a value from Excel and use it in the following line of code: EdgeDr.FindElementByXPath("//table[@class='mls']//td[not(@class='nowrap')and(text()='" + ThisWorkbook.Sheets("D ...

Discover the XPATH for selenium in VBA programming

I am currently facing a challenge with a web page hosted on a secure website. I have attached a snapshot of the specific section I am troubleshooting. The XPATH that identifies the rows of a table (totaling 13 rows) is: //div[@id='Section3'] However, the ...

Error encountered during execution of For-Each loop using VBA and Selenium?

I encountered an issue with the error message "Object doesn't support this property or method." Here is the code snippet that triggered the error: Dim webs, web As Object Set webs = driverg.findElementByCssSelector("*[class^='title-link id-trac ...

Guide to sending keystrokes to a web browser using Selenium and VBA

Recently, I created a straightforward piece of code to log into Gmail using Excel VBA. Here's what it looks like: Sub signInToGmail() Dim bot As New WebDriver Dim i As Integer bot.Start "chrome", "" bot.Wait 3000 bot.FindElementById(& ...

Using ChromeOptions to Manage Webdriver Execution

I encountered a problem in Chrome where I received an error message "You Are Using An Unsupported Command-Line Flag –Ignore-Certificate-Errors. Stability And Security Will Suffer." when running my Selenium code as shown below. Public Sub key() Dim sel ...

Scraping JavaScript Content Webpages with VBA

I'm attempting to extract a table from the Drainage Services Department website. I've written the VBA code below, but it doesn't seem to be working. I suspect that the issue lies in the fact that this particular table is generated using Java ...

How can VBA be used to link JSON/XML data to Excel cells?

After conducting some research on the internet, I am curious to know if there is a way to import Excel sheet data in JSON or XML format. While there are resources available, none seem to offer clear descriptions for my specific case. My goal is to understa ...

Overcoming Troublesome Login Input Box in Web

In an effort to streamline tasks in our office, I am working on automating certain processes. Specifically, this program is designed to log into our insurance company's website and extract information for payroll purposes. Below is the code snippet that I ...

Retrieving valuable information from webpages using VBA

Clicking on the "Export to Excel" button in this link will initiate a download of an Excel sheet containing detailed information about a specific stock. In my Excel VBA project, I need to automate the process of downloading this excel file. My code loops ...

VBA Selenium Chromedriver - Issue with SetPreferences not turning off Save As dialog

https://i.stack.imgur.com/yGpGE.pngI have encountered an issue with a program where I am attempting to bypass the SaveAs dialog box when opening a PDF file. Despite using SetPreferences, the dialog box continues to appear. Has anyone successfully disabled ...

Having trouble extracting a specific field within a JSON on a webpage using VBA

My current project involves extracting property data from this specified link, which returns a JSON response. I've utilized a combination of JSON and VBA converter tools for this task. However, upon executing the script provided below, I consistently encou ...

Steps to upload an image using an API

I am attempting to use an API to upload a file to imgBB, but I encountered the following error message: {"status_code":400,"error":{"message":"Empty upload source.","code":130},"status_txt":&q ...

Capture the content of the currently selected cell, launch a web browser, enter the captured content into the search field, and retrieve the URL of the resulting webpage

I want to achieve the following: Retrieve the value of an active cell (a property address) Launch Edge using a Selenium Edge Driver to go to www.redfin.com Search for the value from the cell (the property address) Capture the URL from the search re ...

VBA Selenium Failing to Check the Checkbox

My current challenge involves using Selenium with Chrome to select a checkbox within a table. The tricky part is that the table actually contains 2 checkboxes which function like radio buttons - when one is clicked, the other automatically unchecks. I&apo ...

Error message: Unable to locate elementError: Selenium VBA

I am encountering an error in SeleniumVBA when trying to upload a file on an internal website. Can someone please assist me in resolving this issue? I am attempting to log in to a website and upload a file from a source to download some data. However, whe ...

Exploring VBA-JSON to extract a JSON array within a JSON object seamlessly in VBA Excel

I am currently working on implementing VBA macros to retrieve real-time data from a website using API calls. To achieve this, I have incorporated the VBA-JSON library into my project. There are two main scenarios that arise when fetching the data: Scenari ...

Is it possible to use Selenium Webdriver in VBA to interact with a button located within a frame?

I have created an automation script for a webpage that contains frames. In order to complete certain tasks, I need to navigate through multiple menu links before returning to the main content. This automation is executed using Access-VBA. Below is a snippe ...

Utilizing XPath with Selenium in VBA

In my search for a node based on text located within a child or grandchild node of its immediate sibling, I came across the following HTML structure: <div> <div class="searchedDivClass" id="DynamicId1"> </div> <div class=" ...

Decoding Labels for Content

Recently, I've been working on a VBA script that scrapes company reporting dates from the London Stock Exchange website. However, I encountered an issue as they have made changes to their web query interface. So, I've been trying to tweak the scr ...

VBA - Selenium does not support pasting dates on Chrome browser

When using internet explorer, I was able to change the date on a web page with the code (code1) provided. However, after switching to Chrome and utilizing Selenium (as in code 2), the date section on the web page only partially changes. For example, if th ...

What is preventing me from utilizing FindElementByXPath on the table from this website?

I am currently using VBA for web scraping with Selenium and ChromeDriver. After logging into a website at , I encountered a table on the main page that contains a lot of information. By inspecting the element, I found the table object highlighted in this ...

Using Excel VBA to extract data from a JSON string and populate cells with the corresponding key:value pairs

I am facing a dilemma with my Excel spreadsheet setup which includes columns: | A | B | C | D | | Job number | Status | Actual Hrs | % Complete | 1___|____________|________|____________|____________| 2___|___________ ...

Extracting data from websites and importing it into Excel with VBA

I am venturing into the world of web scraping for the first time using VBA. My goal is to extract pricing information from our company's distributors and save it in an Excel file for our sales team to analyze. The process involves taking the URL from my w ...

Transformation of Python try-except (or try-catch) code block into VBA for a simple Excel-Selenium workflow

Here is a piece of code I'm working on: #Code snippet in Python try: io = myElm.get_attribute("rel") print(io) except IndexError: d_io = myElm.get_attribute("data-outcome") print(d_io) except: print ...

Using VBA and Selenium to access iframes within HTML with the #document tag

I am currently facing a challenge in accessing the HTML content within two iframes using Selenium Basic in VBA. Due to restrictions on our machines, we are unable to use IE and other tools like Python are not available to us. In the past, I was able to ac ...

How to efficiently manage drop-down menus on a website using VBA specifically designed for Internet Explorer

I am a beginner in VBA and coding, seeking assistance from the community. The purpose of this VBA code is to automate the following steps: Open Internet Explorer Enter user ID and password to login Select the current date Select a specific option (X1) fr ...

Having trouble with clicking a button inside a frame using VBA with Selenium and ChromeDriver

I'm currently facing a challenge related to clicking on a button using Selenium and ChromeDriver in Excel-VBA. Although I have successfully used the same code on many other websites, I am encountering an issue with a specific website. I have tried various ...

Retrieve the highest value from a JSON array in Excel VBA using a non-iterative method

Extracting the highest value of "id" from a JSON data string without iterating can be challenging. The given JSON data string is as follows: "ball_coordinates": [ { "id": 3938706, ...

Automate the process of logging into websites by utilizing selenium webdriver technology

Having trouble logging in to a website using selenium webdriver and excel VBA, specifically getting stuck at the log in page Below is the code being used: Dim bot As New WebDriver bot.Start "chrome", "myurl" bot.Get "/" 'select from drop down bot.FindE ...

You are unable to extract data from an HTML table

I have been encountering an issue while trying to extract data from an HTML table. Every time I attempt to do so, I am faced with an ERROR Message 13 "Type Mismatch". I suspect that the problem lies in my use of incorrect HTML tags. Despite spending severa ...

Utilize ScriptControl for JSON parsing in VBA: convert output into dictionaries and collections

Looking to utilize Microsoft ScriptControl in VBA for parsing a JSON string and converting the resulting Object into Dictionary and Collection objects. While I have the parsing aspect down with ScriptControl, I'm struggling with how to translate the r ...

Utilizing getElementsByClassName for web scraping: encountering inaccurate outcomes

I am attempting to extract the inner text from all classes with the className = "disabled" within the provided snippet of HTML Code: HTML code In my effort to achieve this task using MS Access (VBA), the code I have implemented is as follows: Set IE = C ...

VBA automation is unable to retrieve innerText (or innerHTML, value)

I've encountered a problem with getting innertext this time. Despite trying various alternatives, I have not been successful. Firstly, I am using Selenium on VBA with chromedriver. The source website is "[" This website operates within an Iframe. Aft ...

Having trouble interacting with a button while using Chrome under webdriver control

I have been using a combination of VBA and Selenium to automate tasks in my office. Currently, I am working on a script that will open Chrome at a Dell support page, input serial numbers (SN) from an Excel spreadsheet to check warranty information, and the ...

Dealing with Error 462 in Excel VBA When Using Internet Explorer

This function is designed to loop through the hrefs obtained from the GetData() function, navigate each page, retrieve specific data, and then move on to the next one. Sub CreateDatabase() Dim ieNewPage As InternetExplorer, TableRows As Object, TableR ...

Potential for Commenting in JSON

As a novice, I am venturing into the world of using JSON with VBA. My goal is to import data from an external source into Excel and then apply some VBA magic. The JSON format might seem complex at first glance, so I'm curious if there's a way to include c ...

Excelsior JSON interpreter or Dynamic Link Library

After experimenting with vba-json, I found that it struggles to manage complex JSON strings, especially those with nested structures. Can anyone recommend alternative products that can easily integrate with Excel? ...

What is the best way to update the ChromeDriver or EdgeDriver automatically using VBA?

In my quest to find a solution for automatically updating Selenium EdgeDriver, I have scoured the internet. Anyone who uses SeleniumBasic understands the inconvenience of having to manually download the driver from the website whenever their main browser u ...

Accessing web authentication through VBA

Having some difficulties trying to access my webtext account through VBA. The first hurdle I faced was identifying the tags for the username and password input boxes. After using inspect elements, it seems like the tags are "username" and "password." Howe ...

Using iedriverserver.exe to manage Edge in IE Mode with VBA scripting

Are there any code examples available for controlling Edge in IE Mode using iedriverserver.exe in VBA? I have the exe downloaded but am having trouble adding the necessary library to tools->reference in my VBA project. If anyone has experience with this t ...

Utilizing RapidAPI in VBA Excel: Discovering Domain Name Ownership

I've come across some other discussions on the same topic, but I haven't been able to find a clear answer. I would really appreciate it if someone could assist me with this problem. I'm trying to integrate RapidAPI into my VBA code in Excel to retrieve Wh ...

Utilize VBA-Selenium to export table data into separate Excel sheets

My current task involves extracting information from a website in tabular format based on specific keywords. Below are the keywords and the sample website: apple LG Samsung Nokia Website = www.wikipedia.com I have organized the keywords in Sheet 1 and th ...

Extracting the row and column names of a dynamic field in Selenium Basic with FindElementByXPath()

I'm utilizing Selenium Basic to populate a website with data from my spreadsheet. The structure of the website's HTML code is like this <div> <table cellspacing="0" rules="all" border="1" id="ctl00_ContentPla ...

Steps to Activate Multiple Downloads in Vba Selenium (Edge)

Currently, I am working on a web scraping program where I need to download multiple files on the same page. My issue arises when attempting to download the second file as it prompts me to allow multiple downloads. I have attempted the following code snip ...

Continuing in a loop until the error ceases or until 15 seconds have elapsed

My goal is to create a loop that attempts to click on an element until it is found. If this process exceeds a 15-second limit, a warning message will be displayed. The current issue is that the loop does not respect the 15-second limit and gets stuck in a ...

I need to access a webpage using VBA without relying on Internet Explorer for logging in

I need to access the website by logging in. However, I am facing difficulty in using it. Unfortunately, I am unable to share the username and password due to confidentiality reasons. Below is the code snippet that I have: Sub checkdownload() Dim u ...

Error encountered with Selenium due to NoSuchDriverError in Internet Explorer caused by VBA with

Encountering an issue while trying to launch IE using Selenium Web Driver. The error message states that Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (NoSuchDriver). https://i.stack.imgur.com/hzNLg.png Focusi ...

Problem: Challenge in Iterating and Assigning Variables to HTML Table Elements

I am currently working on a project that involves tracking the order statuses of individual shipments from a list of URLs stored in an Excel sheet. The code I have written is capable of looping through the URLs and extracting information from them successf ...

Troubleshooting API password issues when fetching a Json from an API using VBA in Excel

I'm facing challenges with an API that provides natural gas data. The documentation for this API can be found at . It allows me to access Json-formatted data by inputting a URL into my internet browser. However, in order to download the Json data, I need t ...

How to use Selenium in Excel VBA to wait for a specific value to appear

Having an element with the following HTML: <span id="ContentPlaceHolder1_Label2" designtimedragdrop="1319" style="display:inline-block;color:Firebrick;font-size:Medium;font-weight:bold;width:510px;"></span> Upon clicking the Save button on ...

Guide to selecting the element labeled SRP Banner in the HTML using Selenium and VBA

My attempt to click on a href using Selenium VBA in a webpage is resulting in an error message. The following code snippet shows what I have tried so far: Sub test() Dim Driver As New Selenium.FirefoxDriver Driver.Get "http://sums.99acres.com/sum ...

- Convert text style and include bullet points: • Alter

Is there a way to convert the script from a Mail_Object to HTML in order to properly format lines 3 and 4 into bullet points, as well as change the font on line 5? I have no knowledge of HTML. The code below functions but does not apply any formatting or ...

Extracting Data from HTML Using VBA

I'm attempting to extract the value from the following HTML source code: K<sub>C</sub> [ksi&#8730in]:<br> <input class="test1" type="text" name="fKC" value=""> <br> However, the code I tried using does not seem to ...