Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


VBA google docs

VBA google docs

Hi everybody,
I am VBA newbie programmer winky smile... I would like access (in read/write mode) to spread sheet published by google docs suite, all in VBA code. At the moment, my code is like (sorry for Italian comments...):

Option Compare Database
' MainModule

' Variabili di connessione

' stringhe di connessione per i vari workbook creati con google docs
Public Const connectionWorkbook As String = _

' Varibile per gestire l'applicazione excel

' oggetto di tipo Application
Dim excelApplication As Excel.Application

' workbook excel
Dim excelWorkbook As Excel.workbook

' worksheet excel
Dim excelWorksheet As Excel.Worksheet

' Routine per la gestione dei documenti creati con google docs e access

' imorta il file excel in base al percorso specificato
'   connectionString rappresenta l'url del file da importare
Public Sub ImportExcel(connectionString As String)
    On Error GoTo ErrorMessage:
    ' crea l'oggetto excel
    Set excelApplication = CreateObject("Excel.Application")
    ' ottiene il file desiderato
    Set excelWorkbook = GetObject(connectionString)
    ' imposta il worksheet attivo da utilizzare
    Set excelWorksheet = excelWorkbook.Worksheets(1)
    ' cancella variabili inutilizzate
    Set excelApplication = Nothing
    Set excelWorkbook = Nothing
    Set excelWorksheet = Nothing
    ' gestisce gli errori
    MsgBox "Error number: " & Err.Number & " Description: " & Err.Description, vbOKCancel
End Sub

Thanks a lot for any help


RE: VBA google docs

Best I can tell, it looks like you'd have to do a lot of extra work to do what you're talking about.  See this discussion:

What you might could do is just import the Google spreadsheet data into an Excel workbook, and do whatever code you need there, then re-upload to Google Docs, and allow it to convert back to Google's format.

RE: VBA google docs

I actually held off on replying to this because I didn't have enough time to test the export feature to see if it was scriptable.

One course of action available to you is using the Google Doc as a data source. Once the document is created, you can send an XMLHTTPRequest to a specific URL. I know for a fact that you can retrieve data this way, not really certain on how to WRITE the data though.

Also this will only apply to the data, not the formatting. is going to be your best resource for this.
Believe me, I would really like to get into the details of this for my own purposes, but I just can't, I don't have the time.

RE: VBA google docs

Thanks for your suggestions :D, I am writing VBA code to solve this problem... if I will solve it, I will post solution here winky smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close