I am having some troubles with a VBA code that should import excel data to my access database. When i run the code, i get a RunTime error "Runtime error 438 Object doesn't support this property or method ". From my readings in other forums; I understand that the problem might be a library problem (referencing a library while using another one) I'm somewhat new to VBA. I don't know if it's related, but before i had this error i had an "erreur 429 activeX component can't create object" that i solved.
here is the portion of the code that i think is responsible.
On Error GoTo erreur
'déclaration des variables
Dim app As Object
Dim wkb As Object
Dim wks As Object
'initialisation des variables
Set app = CreateObject("Excel.Application")
Set wkb = app.Workbooks.Add
Set wks = wkb.Worksheets(1)
wkb = app.Workbooks.Open("C:\Users\souleimane\Desktop\Internship\donnee_excel\table_de_corresp.xls")
wks = wkb.Worksheets("sheet1")
I tried to run the compile option on the debug menu, but nothing poped up. Any help is appreciated, and if you think this is not the portion of the code responsible then i can post the remaining.