I have this code and I want the Excel file to just open and not output it to somewhere. How do I change my code to do that?
Private Sub cmdExport_ALLORGS_Click()
'On Error GoTo Err_cmdExport_ALLORGS_Click
Dim username As String, stDocName As String, stFilename As String
If MsgBox("Click YES to export all Allotments to Excel, NO to export current Allotment.", vbYesNo, "Export Options") = vbYes Then
'stDocName = "QryRecapTest_ExcelOutputALL"
stDocName = "Copy of Allot_Q"
DoCmd.OutputTo acOutputQuery, "Copy Of Allot_Q", "Excel97-Excel2003Workbook(*.xls)", "", True, "", , acExportQualityScreen
' Exit Sub
' MsgBox Err.Description
' Resume Exit_cmdExport_ALLORGS_Click