If I have a spreadsheet where I've referenced MS Outlook 14.0 Object Library from the VBA editor, and a user who only has MS Outlook 12.0 installed, then when that user opens the spreadsheet, they get a compile error on this line:
Range("export_date") = Date - 1
If they go into Tools, References, in the references list, there is this error:
MISSING: MS Outlook 14.0 Object Library
If they deselect that library, and instead select
MS Outlook 12.0 Object Library
...the code then properly compiles and the spreadsheet works fine for them.
I don't really understand why it fails on the Date() function, as that is VBA function, not an Outlook function. But even more important, is there a way to avoid this situation? The only thing I can think of is to not set references, and just use variables of type Object and instantiate via CreateObject("Outlook.Application"), etc, but I hate to give up strong typing, etc.
Can anyone suggest a superior way to handle this issue of backwards compatibility with older versions of MS Office?