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
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