From within Excel VBA, how do I open a specific Access database in exclusive mode (to make sure others are not using the database), and then run a DoCmd to run a macro within that database?

I have managed to open the database in exclusive mode by opening an exclusive connection to it, but then the DoCmd errors. There must be either a different way to open the database exclusively so that the DoCmd will run, or a different way to run the DoCmd with the exclusive connection.

Thanks for any help offered.