I am creating a script to print a report using a macro from an Access database and I am trying to make it automatic for every Monday. However when my script is opening the file, there is the security warning and I need to click open to continue.
This file may not be safe if it contains code that was intended to harm your computer. Do you want to open this file or cancel the operation?
Is there a way to bypass this security message when opening the database or to change the security options just for the script?
Here is the code:
Dim accessApp
Set accessApp = CreateObject("Access.Application")
accessApp.Visible = False
accessApp.OpenCurrentDataBase "C:\db1.mdb"
accessApp.Run "MyMacro"
accessApp.Quit
Set accessApp = Nothing
WScript.Quit