Note that there are some explanatory texts on larger screens.

plurals
  1. POUse Excel VBA to fill out and submit Google Docs form
    primarykey
    data
    text
    <p>I'm trying to do something like <a href="https://stackoverflow.com/questions/2128367/scripting-a-google-docs-form-submission">this post</a> but with Excel VBA. I would like to submit a response on a google docs form each time a button is pressed on an Excel add-in. The addin will be an XLA file and written in VBA. </p> <p>I want to be able to collect what features the users are using. If someone has a better solution, I'm open.</p> <p>---Edit---</p> <p><a href="http://spreadsheets.google.com/viewform?hl=en&amp;pli=1&amp;formkey=dHFTMzkwR2RpY2tzSUNnbVhIcDN3WWc6MA" rel="nofollow noreferrer">This</a> is the form I am trying to write to (excerpt of the code for one of the fields.)</p> <pre><code>&lt;div class="errorbox-good"&gt; &lt;div class="ss-item ss-item-required ss-text"&gt; &lt;div class="ss-form-entry"&gt; &lt;label for="entry_0" class="ss-q-title"&gt; UserName &lt;span class="ss-required-asterisk"&gt;*&lt;/span&gt; &lt;/label&gt; &lt;label for="entry_0" class="ss-q-help"&gt;&lt;/label&gt; &lt;input type="text" id="entry_0" class="ss-q-short" value="" name="entry.0.single"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>--EDIT 2-- This is what I've tried so far, but it is still not working. I am getting an error on the line that says ".UserName.Value = Environ("username")" I suspect it is because it is not finding the item .username.</p> <pre><code>Private Sub GoogleForm() Dim ie As Object Set ie = CreateObject("InternetExplorer.Application") On Error GoTo errHandler With ie .navigate "http://spreadsheets.google.com/viewform?hl=en&amp;cfg=true&amp;formkey=dHFTMzkwR2RpY2tzSUNnbVhIcDN3WWc6MA" Do While .busy: DoEvents: Loop Do While .ReadyState &lt;&gt; 4: DoEvents: Loop With .document.Forms(1) 'Username .UserName.Value = Environ("username") 'Key .Key.Value = "00qwe-12ckd" .submit End With Do While Not CBool(InStrB(1, .document.URL, _ "cp_search_response-e.asp")) DoEvents Loop Do While .busy: DoEvents: Loop Do While .ReadyState &lt;&gt; 4: DoEvents: Loop MsgBox .document.all.tags("table").Item(11).Rows(1).Cells(7).innerText End With Exit Sub errHandler: ie.Quit: Set ie = Nothing End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload