Translator Note:This article is greatly accompanied by translation from the www.vba-ie.net of the course, only to do Japanese learning, such as reproduced in this article please inform. all of the text is not replaced with Chinese interface, because the author of the computer is also a Japanese system, hope to understand.
As a primer, this tutorial covers the basics of controlling IE from using VBA, getting data from a Web page , to a broader range of practical content . But many people do not even know that Excel VBA can operate on the browser, so today only know this friends, please be sure to try to challenge it!
Learning methods for Excel VBA
This tutorial is mainly composed of the following parts
- The preparation of IE control
- Basic control of IE
- Basic operations for HTML elements
- Basic operation of HTML form
- Basic operation of HTML frame
Through the above study, can achieve from the basic operation of IE Web page to write a complex program level. instead of just explaining one program, we're working on a practice-based approach to more understandable content. In addition, the tutorial also documented the operation of the IE Web page executable code example, please refer to the reader.
The method of EXCEL VBA to control IE
If you have mastered the Excel VBA control IE method, you can write the following list of very convenient programs.
- Automatic Login Processing
- Automatic entry of goods and processing of receiving orders
- Automatic Web browsing
- Web page automatically browse and click
- Automatic collection of Web page data (web scraping)
- Automatic download of Web images
- HTML files are automatically generated
- Automatically send files to the Web server
Although we have written a variety of programs, the efficiency improvements brought about by automation have not been counted. In addition, the site we are currently using does not use a CMS (a system that can manage and update the site), but is only managed with Excel VBA. Here's what we manage with automation.
- Automatic generation of Html/css/rss files (automatic conversion of UTF-8 characters)
- Automatic compression of HTML/CSS files
※ Automatic compression using Web service and DLL (program Files of Windows)
- Automatic sending of html/css/javascript/picture files to the Web server
※ If the folder does not exist automatically generated folder
- Ping Automatic Sending
- Web page display speed check (automatic operation of Gtmetrix site via IE control)
With the CMS to control the site, in any case will touch the HTML source code, so from the point of view of SEO, small-scale site is suitable (with CMS). In addition, the following is the public access to the website for half a year. This is also carried out in the internal strategy of SEO and HTML concise, read the results of high-speed.
At the same time, through the Gtmetrix speed test, the above display speed can be maintained on all pages more than 90% (a-level) level.
We also realized the automatic operation of the Gtmetrix website via IE control, automatic compression of the Html/css file using Web service, and automatic uploading to the Web server.
Automatic login, data collection (Web scraping) and other functions, the use of people should be more, these things as long as there are ideas can be achieved through automation. So try to challenge them in order to maximize their fulfillment.
"Control IE with Excel VBA" is written in front