DoCmd.TransferSpreadsheet-save to Sharepoint

rutica

Registered User.
Local time
Today, 16:12
Joined
Jan 24, 2008
Messages
87
I am using Access 2003.

I have the following code to create a spreadsheet in Excel.

Code:
Private Sub cmdExportToExcel_Click()
On Error GoTo ProcError
Dim strFilePath As String

strFilePath = CurrentProject.Path & "\Template_rawdata.xls"
 
If Dir(strFilePath) <> vbNullString Then
   Kill strFilePath
End If

DoCmd.TransferSpreadsheet TransferType:=acExport, SpreadsheetType:=acSpreadsheetTypeExcel97, TableName:="qryReporting Projects", Filename:=strFilePath, HasFieldNames:=True
MsgBox "Records have been exported to" & vbCrLf _
& strFilePath & ".", vbInformation, "Export Completed."
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in cmdExportToExcel_Click event procedure..."
Resume ExitProc
End Sub


Instead of the CurrentProject.Path, can I save the Excel spreadsheet to a Sharepoint site? If so, what would I replace CurrentProject.Path with?

Thanks,
 

Users who are viewing this thread

Back
Top Bottom