Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Marco82 (Programmer) (OP)
25 Jul 10 12:27
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 = _
    "https://..."


' 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
ErrorMessage:
    MsgBox "Error number: " & Err.Number & " Description: " & Err.Description, vbOKCancel
End Sub

Thanks a lot for any help

    
 
kjv1611 (TechnicalUser)
29 Jul 10 22:53
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:
http://www.google.com/support/forum/p/Google%20Docs/thread?tid=55044d589d2e0bc3&hl=en

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.
Gruuuu (Programmer)
30 Jul 10 8:01
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.

http://code.google.com/apis/spreadsheets/ 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.
Marco82 (Programmer) (OP)
2 Aug 10 5:51
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

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!

Back To Forum

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