Hi All,
When i use the following code and call this in macro with Runcode function,i get a error msg stating, " you cancelled the previous operation "
please help
ExporttoExcel
'
'------------------------------------------------------------
Function ExporttoExcel()
On Error GoTo ExporttoExcel_Err
' Customer Report
DoCmd.OpenQuery "Customer Report", acNormal, acEdit
DoCmd.OutputTo acOutputQuery, "Customer Report", acFormatXLS, "L:\Customer\Customer Report " & Format(Date, "DDMMMYYYY") & ".xls", , ""
ExporttoExcel_Exit:
Exit Function
ExporttoExcel_Err:
MsgBox Error$
Resume ExporttoExcel_Exit
End Function
When i use the following code and call this in macro with Runcode function,i get a error msg stating, " you cancelled the previous operation "
please help
ExporttoExcel
'
'------------------------------------------------------------
Function ExporttoExcel()
On Error GoTo ExporttoExcel_Err
' Customer Report
DoCmd.OpenQuery "Customer Report", acNormal, acEdit
DoCmd.OutputTo acOutputQuery, "Customer Report", acFormatXLS, "L:\Customer\Customer Report " & Format(Date, "DDMMMYYYY") & ".xls", , ""
ExporttoExcel_Exit:
Exit Function
ExporttoExcel_Err:
MsgBox Error$
Resume ExporttoExcel_Exit
End Function