Hi I am trying to use the following code to export tables from access to excel
I am getting error object does not support property or method at the end
Set objexcel = New Excel.Application
objexcel.Visible = True
If Dir("C:\reports\Data_Analysis1.xls") = "" Then
objexcel.Workbooks.Add
Set wbexcel = objexcel.ActiveWorkbook
Set objSht = wbexcel.Worksheets("Sheet1")
Else
Set wbexcel = objexcel.Workbooks.Open("C:\Documents and Settings\TAYYAPP\Desktop\test folder\reports\ERROR REPORT4.xls")
Set objSht = wbexcel.Worksheets("Sheet1")
End If
objSht.Activate
objexcel.DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "UTYP_Anzahl", "C:\Reports\Data_Analysis1.xls", True