This error pretends to be about your code, and it isn’t. The VBA editor stops on some innocent built-in function — Date, Left, Format, Trim — and claims it can’t find a library. The real problem sits in the project’s References list: one checked reference is missing on this machine, and its absence breaks name resolution for everything else too.
If no entry says MISSING but the error persists, a reference may be present but the wrong version: uncheck and re-add the main suspects. Saving the file after clearing the missing reference makes the fix permanent for the next machine too, as long as that machine doesn’t need the library either.
Why does it highlight Date or Left()? Those are built in. When a reference is broken, VBA can’t fully resolve names — and the first built-in name it trips on gets highlighted. The highlight is a symptom, not the culprit.
The file works on my PC but not a colleague’s. Classic missing-reference behaviour: your PC has the library, theirs doesn’t. Clearing the MISSING entry in the file (or installing the component on their PC) fixes it for both.