Jass Saini
asked on
How to get an excel file to OPEN without saving it somewhere
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"
Else
stDocName = "Copy of Allot_Q"
End If
DoCmd.OutputTo acOutputQuery, "Copy Of Allot_Q", "Excel97-Excel2003Workbook(*.xls)", "", True, "", , acExportQualityScreen
'Exit_cmdExport_ALLORGS_Click:
' Exit Sub
'Err_cmdExport_ALLORGS_Click:
' MsgBox Err.Description
' Resume Exit_cmdExport_ALLORGS_Click
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER