I am using Access 2003.
I have the following code to create a spreadsheet in Excel.
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,
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,