R
RedHeadedMonster via AccessMonster.com
Im exporting a query to excel from a form. I've done this before, copied and
pasted the code from the previous time (works perfectly), this time Im
getting a bizarre error.
here are the first few lines of the code:
Dim xlApp As Excel.Application
Dim xlSheet As Excel.Worksheet
Dim xlWorkbook As Excel.Workbook
Dim acQuery As QueryDef
Dim objRST As Recordset
Dim strQueryName As String
Dim strSheetName As String
strQueryName = "rptPartsDetailsExcel"
strSheetName = Left(strQueryName, 11)
strSheetName = Trim(strSheetName)
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWorkbook = xlApp.Workbooks.Add
Set objRST = Application.CurrentDb.OpenRecordset(strQueryName)
Last line now gets the following error: "Too few Parameters. Expected 4"
WTH? It works perfectly on the other form.
Help would be appreciated.
RHM
pasted the code from the previous time (works perfectly), this time Im
getting a bizarre error.
here are the first few lines of the code:
Dim xlApp As Excel.Application
Dim xlSheet As Excel.Worksheet
Dim xlWorkbook As Excel.Workbook
Dim acQuery As QueryDef
Dim objRST As Recordset
Dim strQueryName As String
Dim strSheetName As String
strQueryName = "rptPartsDetailsExcel"
strSheetName = Left(strQueryName, 11)
strSheetName = Trim(strSheetName)
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlWorkbook = xlApp.Workbooks.Add
Set objRST = Application.CurrentDb.OpenRecordset(strQueryName)
Last line now gets the following error: "Too few Parameters. Expected 4"
WTH? It works perfectly on the other form.
Help would be appreciated.
RHM