FYI, I am using Microsoft Excel 2007 in Windows 7.
Is it possible to click on a Google spreadsheet's File menu -> Download As -> Microsoft Excel (.xlsx) without using VBA's Sendkeys command? So far, I know how to login to my Gmail account and navigate to a Google spreadsheet. Here's the code that I have so far:
I used Firefox's "Pick an element from the page" button to see what's going on the File menu button, and the HTML code changes each time when I hover my mouse over File Menu, click on Download As, and Microsoft Excel (.xlsx). There's no input type, submit, or click code.
Thanks for any help.
Is it possible to click on a Google spreadsheet's File menu -> Download As -> Microsoft Excel (.xlsx) without using VBA's Sendkeys command? So far, I know how to login to my Gmail account and navigate to a Google spreadsheet. Here's the code that I have so far:
Code:
Sub Test_GS()
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Dim oHTML_Element As IHTMLElement
Set oBrowser = New InternetExplorer
oBrowser.Height = 1000
oBrowser.Width = 1000
oBrowser.Silent = False
oBrowser.Navigate "https://www.google.com/accounts/Login"
oBrowser.Visible = False
Do
Loop Until oBrowser.ReadyState = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.Document
Application.Wait DateAdd("s", 3, Now)
HTMLDoc.all.Email.Value = "EMAIL"
HTMLDoc.all.Passwd.Value = "PASSWORD"
For Each oHTML_Element In HTMLDoc.getElementsByName("signIn")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next
Do
Loop Until oBrowser.ReadyState = READYSTATE_COMPLETE
Application.Wait DateAdd("s", 1, Now)
oBrowser.Navigate "https://docs.google.com/spreadsheet/ccc?key=0Ah4Bis8FTYfCdDJILVdYOG1EZEYtc1N3NF96dHZSYkE&usp=drive_web#gid=0"
Do
Loop Until oBrowser.ReadyState = READYSTATE_COMPLETE
Application.Wait DateAdd("s", 3, Now)
'''Code to click on File menu -> Download As -> Microsoft Excel (.xlsx) goes here'''
oBrowser.Visible = True
End Sub
I used Firefox's "Pick an element from the page" button to see what's going on the File menu button, and the HTML code changes each time when I hover my mouse over File Menu, click on Download As, and Microsoft Excel (.xlsx). There's no input type, submit, or click code.
Thanks for any help.