| Start |
|---|
VBScript Regular Expressions Tools> References> Microsoft VBScript Regular Expressions #.#
CodeYou can use this functions to get RegEx results, concatenate all matches (if more than 1) into 1 string, and display result in excel cell. |
Scripting File System Object Tools> References> Microsoft Scripting Runtime MSDN-Accessing Files with FileSystemObject (opens new window) The File System Object (FSO) model provides an object-based tool for working with folders and files. It allows you to use the familiar object.method syntax with a rich set of properties, methods, and events to process folders and files. You can also employ the traditional Visual Basic statements and commands. The FSO model gives your application the ability to create, alter, move, and delete folders, or to determine if and where particular folders exist. It also enables you to get information about folders, such as their names and the date they were created or last modified. MSDN-FileSystemObject topics (opens new window): "...explain the concept of the FileSystemObject and how to use it."
exceltrick-FileSystemObject in VBA – Explained (opens new window) |
Scripting Dictionary object Tools> References> Microsoft Scripting Runtime Scripting.Dictionary object (opens new window) |
Internet Explorer Object Tools> References> Microsoft Internet Controls MSDN-InternetExplorer object (opens new window) Controls an instance of Windows Internet Explorer through automation. Internet Explorer Objec Basic MembersThe code below should introduce how the IE object works and how to manipulate it through VBA. I recommend stepping through it, otherwise it might error out during multiple navigations. Web ScrapingThe most common thing to do with IE is to scrape some information of a website, or to fill a website form and submit information. We will look at how to do it. Let us consider example.com (opens new window) source code: We can use code like below to get and set informations: What is going on? The key player here is the .Document, that is the HTML source code. We can apply some queries to get the Collections or Object we want. ClickTo follow a link on a site, we can use multiple methods: Microsoft HTML Object Library or IE Best friendTo get the most out of the HTML that gets loaded into the IE, you can (or should) use another Library, i.e. Microsoft HTML Object Library. More about this in another example. IE Main issuesThe main issue with IE is verifying that the page is done loading and is ready to be interacted with. The Also, using IE just to scrape HTML content is OVERKILL. Why? Because the Browser is meant for browsing, i.e. displaying the web page with all the CSS, JavaScripts, Pictures, Popups, etc. If you only need the raw data, consider different approach. E.g. using XML HTTPRequest (opens new window). More about this in another example. Syntax
RemarksWhen an application supports Automation, the objects the application exposes can be accessed by Visual Basic. Use Visual Basic to manipulate these objects by invoking methods on the object or by getting and setting the object's properties. If you use the objects in other applications as part of your Visual Basic application, you may want to establish a reference to the object libraries of those applications. Before you can do that, you must first be sure that the application provides an object library. Allows you to select another application's objects that you want available in your code by setting a reference to that application's object library. Creates an Automation object of the specified class. If the application is already running, CreateObject will create a new instance. |
Read Article
https://develop.horje.com/learn/1434/reference