C
Chad
I have a Subform on the main form that I can export to Excel, but I
would like for that data to open after the output command. behind the
click properties, I have:
Private Sub exportexcel_Click()
DoCmd.OutputTo acOutputForm, "frm_subform", acFormatXLS, _
strPath & "C:\\ServerData.xls" ', AutoStart:=-1
OpenExcelFile ("C:\\ServerData.xls")
Dim objXL As Object
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject(strPathToFile)
objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True
End Sub
I am getting a "sub or function not defined" error.
Thanks in advance!
would like for that data to open after the output command. behind the
click properties, I have:
Private Sub exportexcel_Click()
DoCmd.OutputTo acOutputForm, "frm_subform", acFormatXLS, _
strPath & "C:\\ServerData.xls" ', AutoStart:=-1
OpenExcelFile ("C:\\ServerData.xls")
Dim objXL As Object
On Error Resume Next
Set objXL = GetObject(, "Excel.Application")
Set objXL = GetObject(strPathToFile)
objXL.Application.Visible = True
objXL.Parent.Windows(1).Visible = True
End Sub
I am getting a "sub or function not defined" error.
Thanks in advance!