Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA google docs

Status
Not open for further replies.

Marco82

Programmer
Jul 25, 2010
4
HR
Hi everybody,
I am VBA newbie programmer ;-)... 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
ErrorMessage:
MsgBox "Error number: " & Err.Number & " Description: " & Err.Description, vbOKCancel
End Sub

Thanks a lot for any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top