Visual Basic for Applications (VBA)

Click webpages button entry via vba

I run the following code with this argument ""
Function GoogleTrends(URL As String) As Variant()
 Dim browser As SHDocVw.InternetExplorer
 Set browser = CreateObject("InternetExplorer.Application")
 browser.Navigate (URL)
 browser.StatusBar = False
 browser.Toolbar = False
 browser.Visible = True
 browser.Resizable = False
 browser.AddressBar = False
 'Pause the macro using a loop until the
 'page is fully loaded
 Loop Until browser.ReadyState = READYSTATE_COMPLETE
 'Set gearwheel = browser.Document.Forms(0).Item(...)
 Exit Function
 GoogleTrends = CVar(0)
End Function
Please set a breakpoint in the line browser.Quit.
Now have a look on the website opened by GoogleTrends. In the upper left there is a button looks like a gearwheel. I want to click the buttons entry
Download as CSV. How to do this?
I tried the following without success:
1) Right click on the website and select View Source.
2) In the websites code I have searched for Download as CSV.
3) Due to my understanding of the websites structure the buttons id is
4) By parsing the object browser.Document.getElementById("exportMI"), I have not found a way to select or submit the entry
Download as CSV!
What is wrong?
Thank you very much!
Any ideas?
Hi Lloyd,
Thank you for posting in the MSDN Forum.
According to your description, I think your major concern is about IE automation using VBA. So, I'll move your thread to
Visual Basic for Applications (VBA) forum for better handling.
The experts there are more familiar with your issue and may give your more suggestions or workarounds.
Thank you for your understanding.
Best regards,Quist Zhang [MSFT]
MSDN Community Support | Feedback to us
Hi Quist,
thank you very much!

Related Links

Splitting a range into to 2 ranges based on values from another range
VBA - Select Case Statement - Array
For/Next Loop not working
Using Dictionary in VBA
Changing destination sheet using VBA
VB script for Excel 2010 that will do a search for any word or phrase in my entire workbook.
Reading data from Notepad and writing into a table in Access
VBA code for saving a ppt working in debug mode,not in real run
VBA Move Paragraphs in Document Using XL
Method range of object_Worksheet failed???
Adding text labels to points on a chart.
Is it possible to set project references at run-time?
Using a condition of =H1<H2 or =H1>H2, How to format H1 instead of H2?
Conditionally formatting a looped range of cells based on value in other cell in VBA
How to get the List of Visible Items from a Pivot Field using VBA
How to run a macro when a Filter is applied on Particular Pivot Field


Visual FoxPro
SQL Server
Windows Forms
Windows Live Developer
Office Live Development
Archived Forums I-L
Archived Forums N-R
In-App Advertising (Ad...
Kinect for Windows SDKs
Suggestions and Feedba...
Visual F#
Visual Studio LightSwi...
Visual Studio Code Vis...
Tools for Apache Cordova
Windows App Studio Beta
Windows Desktop Develo...
Peer-to-Peer Networkin...
Application Security f...
User Interface develop...
Windows Desktop Search...
Windows Desktop SDK
Windows Desktop Web Se...
Open XML Format SDK
SharePoint Legacy Vers...
Azure Storage
Azure Media Services
Azure Networking (DNS,...
Azure Backup
Azure Cache
Azure App Service - AP...
Azure Functions
Azure Analysis Services
Azure Time Series Insi...
Software Modeling Tools
BizTalk Server General
WCF Data Services
SyncFx - General [Read...
Microsoft Robotics - S...
SQL Server Integration...
Database Design
SQL Server Migration
Standard 2009: Tools
ClickOnce and Setup & ...
Windows Server 2008 Ap...
Live Connect (Archived)
Windows Live Messenger...
CRM Deployment
App Linking
Office XML, ODF, and B...
Microsoft Lync Persist...
Microsoft Unified Comm...
Performance Profiling ...
Expression Encoder
Connected Services Fra...
Retired SharePoint Acc...
App Producer (archived)
Developer Documentatio...
Dryad, DSC, and DryadL...
General Troubleshootin...
General Windows MultiP...
Office Development wit...
Office Live Small Busi...
POS for .NET
Parallel Programming w...
Storage Platform – ATA
SQL Server 2014 In Azu...
SQL Server 2014 Setup ...
Team Foundation Server...
Team Foundation Server...
Visual Basic Express E...
Visual Basic Interop a...
Visual C# Express Edition
Visual C++ Express 200...
Visual C++ MFC and ATL
Visual Studio 2008 IDE...
Visual Studio Code Ana...
Visual Studio Lab Mana...
Windows MultiPoint Mou...
Building Windows Store...
Expression Blend for W...
XML Paper Specificatio...
Windows Phone Preview ...
OneDrive Development (...


Encrypt Message