Welcome to Q&A forum!
According to your description, you could try to disable Alert/Warning Messages by using some code in Excel. I fould an official article Application.DisplayAlerts property (Excel), you may have a look.
Besides, due to we are more focused on general issues about Excel client, if you need more help about VBA code, please refer to Office VBA support and feedback.
Per my research, you may try to protect your VBA with password by the following steps.
- Open the Excel file, Press Alt+F11 to open VBA edior.
- Click Tools>VBA Project properties>Protection>check Lock project for viewing>enter and confirm a password>OK in turn.
Regarding to protect the queries, please go to Review>Protect Workboot>check Structure>enter password>OK to check whether it works.
Any updates or misunderstandings, please let me know.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.