Making progress ...
@isladogs - Thanks - I missed the part of your comment with the #. I'd seen that for 32/64-Bit Bitness, but never knew what it did. I learned something new.
If it doesn't work, I have another idea. The sub that is failing is called Export2XLS. Rather than splitting it into two functions and fixing 30 calls to it with conditionals, I think this should work:
Rename Export2XLS as Export2XLS_M365. Copy Export2XLS_M365 as Export2XLS_O2016. Comment out M365 only references in Export2XLS_O2016. Optionally comment out conditional checks in Export2XLS_M365.
Create a new sub Export2XLS with only 5 lines of code
If IsM365 = True Then
Call Export2XLS_M365
Else
Call Export2XLS_O2016
End If
It is much more complicated than your idea (which is why I will try yours first), and I think it still would not compile in O2016, but I think it would work in O2016 since the M365 variables are never called (and it is easier than changing 30 function calls to conditionals and then potentially changing them all back. I should have seen it sooner.
@AtzeX - Good suggestion, but a bit late. Would have eliminated the idea for the IsM365 subroutine. But since I use that for both Outlook and Excel, I would have to test in Outlook and it probably doesn't work there. But a good approach to the problem.
@Gasman - I appreciate the effort, but
@AtzeX 's comments are actually on-point here. Sensitivity labels don't exist in Access (at least yet - fingers crossed it stays that way!!!). They were added in M365 (and apparently in something called Azure) to Excel, Outlook, Word, and ??? Powerpoint. What I am doing is setting sensitivity labels in VBA that is called from Access and manipulates Excel and Outlook. (But you can't set the labels in Outlook (yet?) and have to use SendKeys - which is ugly, but working.