In recent days, a colleague sent me an Access database to make some changes to, and I did, and sent it back to him. On opening it, my colleague encountered a compile error :
Compile error : Can't find project or library
On looking at the 'References' list (my suggestion), he saw amongst the list 'MISSING : Microsoft Excel 16.0 Object Library' (with 'Location' C:\Program Files (x86)\Microsoft Office\root\Office 16\EXCEL.EXE). I suggested that he un-tick that Reference, and he did.
That seemed to resolve the "Can't find project or library" compile error. However, now he's getting another compile error :
Compile error : User-defined type not defined
And that compile error points to the following line in the VBA code :
Dim xlApp As Excel.Application
So I take it that's due to the 'Microsoft Excel 16.0 Object Library' Reference having been un-ticked (see above).
It now transpires that there had been a miscommunication : I hadn't realized that the database I had been sent was Access 2013. I worked on it in Access 2021. That may have triggered these problems, I suppose.
Excuse my ignorance of these things, but : How can this be fixed now, please ?
TIA
Compile error : Can't find project or library
On looking at the 'References' list (my suggestion), he saw amongst the list 'MISSING : Microsoft Excel 16.0 Object Library' (with 'Location' C:\Program Files (x86)\Microsoft Office\root\Office 16\EXCEL.EXE). I suggested that he un-tick that Reference, and he did.
That seemed to resolve the "Can't find project or library" compile error. However, now he's getting another compile error :
Compile error : User-defined type not defined
And that compile error points to the following line in the VBA code :
Dim xlApp As Excel.Application
So I take it that's due to the 'Microsoft Excel 16.0 Object Library' Reference having been un-ticked (see above).
It now transpires that there had been a miscommunication : I hadn't realized that the database I had been sent was Access 2013. I worked on it in Access 2021. That may have triggered these problems, I suppose.
Excuse my ignorance of these things, but : How can this be fixed now, please ?
TIA