OK I am having a little trouble with this issue and from my Internet research I have complied the following code:
So basically the code works to create the file, the problem is trying to open the file. I get a "File not Found" and I don't understand why, because when I go to the file location the xls is there.
Code:
Private Sub Submit_Click()
If Me.combobox1.Value = "Table1" Then
DoCmd.OutputTo acOutputTable, "Table1", acFormatXLS, "C:\Documents and Settings\Igawa\Desktop\temp.xls"
Set objShell = CreateObject("Wscript.Shell")
intMessage = MsgBox("Open File?", _
vbYesNo, "Access Denied")
If intMessage = vbYes Then
stAppName = "excel.exe C:\Documents and Settings\Igawa\Desktop\temp.xls"
Call Shell(stAppName, 1)
Else
Wscript.Quit
End If
End Sub
So basically the code works to create the file, the problem is trying to open the file. I get a "File not Found" and I don't understand why, because when I go to the file location the xls is there.