L
Leinad
I am trying to create a button on a form that has many filters on it that
filters the underlying subform. I want to be able to transfer the data to
excel from the filtered subform on the click of this button and I only want
the filtered data to be transfered. I attached the code at the bottom. I
would greatly appreciate if someone can help me out.
Private Sub Command16_Click()
Dim app As Excel.Application
Dim xl As Excel.Workbook
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tbl_Tickets",
"C:\MyPath", True
Set app = CreateObject("Excel.Application")
Set xl = app.Workbooks.Open("C:\MyPath")
app.Visible = True
Set ws = xl.Worksheets(1)
Set ws = Nothing
Set xl = Nothing
End Sub
filters the underlying subform. I want to be able to transfer the data to
excel from the filtered subform on the click of this button and I only want
the filtered data to be transfered. I attached the code at the bottom. I
would greatly appreciate if someone can help me out.
Private Sub Command16_Click()
Dim app As Excel.Application
Dim xl As Excel.Workbook
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "tbl_Tickets",
"C:\MyPath", True
Set app = CreateObject("Excel.Application")
Set xl = app.Workbooks.Open("C:\MyPath")
app.Visible = True
Set ws = xl.Worksheets(1)
Set ws = Nothing
Set xl = Nothing
End Sub