I am using this code it is giving me error 3828 at the line marked red. Says cannot reference a table with multi-valued field using an IN clause that refers to another database. Query has fields which gets input from combo box but only one value is saved in it.
Code:
Dim xl As Object ''Excel.Application
Dim wb As Object ''Excel.Workbook
Dim ws As Object ''Excel.Worksheet
Dim ch As Object ''Excel.Chart
Dim myRange As Object
Set xl = CreateObject("Excel.Application")
sExcelWB = "C:\Users\book2.xls"
'This will overwrite any previous run of this query to this workbook
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "AQuery", _
sExcelWB, True
Set wb = xl.Workbooks.Open(sExcelWB)
''Sheets are named with the Access query name
Set ws = wb.Sheets("Sheet1")
Set ch = xl.Charts.Add
ch.ChartType = xlColumnClustered
xl.Visible = True
xl.UserControl = True
''Still not saved
End Sub