In my Docmd.TransferSpreadsheet line in the code below, I need the syntax or wildcard that will allow me to export this report to any user's desktop. I was told %username%, but that does not work. Does anyone have any ideas?
'------------------------------------------------------------
' PS_Contract_Perf_by_Qtr
'
'------------------------------------------------------------
Function PS_Contract_Perf_by_Qtr()
On Error GoTo PS_Contract_Perf_by_Qtr_Err
DoCmd.SetWarnings False
' Transfer Data to Template
DoCmd.TransferSpreadsheet acExport, 8, "Contract Purchases by Quarters", "C:\Documents and Settings\%username%\Desktop\QuikReports\PSContractPerformanceByQtr.xls", True, "Data"
' Open PS Contract Performance By Qtr
DoCmd.RunMacro "Open Contract Perf by Qtr", , ""
PS_Contract_Perf_by_Qtr_Exit:
Exit Function
PS_Contract_Perf_by_Qtr_Err:
MsgBox Error$
Resume PS_Contract_Perf_by_Qtr_Exit
End Function
'------------------------------------------------------------
' PS_Contract_Perf_by_Qtr
'
'------------------------------------------------------------
Function PS_Contract_Perf_by_Qtr()
On Error GoTo PS_Contract_Perf_by_Qtr_Err
DoCmd.SetWarnings False
' Transfer Data to Template
DoCmd.TransferSpreadsheet acExport, 8, "Contract Purchases by Quarters", "C:\Documents and Settings\%username%\Desktop\QuikReports\PSContractPerformanceByQtr.xls", True, "Data"
' Open PS Contract Performance By Qtr
DoCmd.RunMacro "Open Contract Perf by Qtr", , ""
PS_Contract_Perf_by_Qtr_Exit:
Exit Function
PS_Contract_Perf_by_Qtr_Err:
MsgBox Error$
Resume PS_Contract_Perf_by_Qtr_Exit
End Function