Select Microsoft Office Tools → Digital Certificate for → VBA project in the startup menu of Microsoft Office, type the name of the digital certificate in the "Your Certificate Name" box of the pop-up "Create Digital Certificate" dialog box, and then click "OK" to create your own digital certificate.
Hong Xiang adds signature.
Open the file with a macro, select Tools → Macros →Visual Basic Editor, and then select Tools → Digital Signature in the editor. In the Digital Signature dialog box, click Select, select the digital certificate created in step 4, and then click OK to return.
Open the file that contains the signed macro.
When a warning appears, select the Always trust macros from this publisher check box, and then click Enable macros. Open the Excel file again, and no security warning will be displayed.
You can also execute the macro you created by clicking Macro on the Tools menu. Through the above introduction, such a window prompt will no longer pop up when any macro runs.