Macro Security Bypass

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have read a lot on this but haven't found my answer yet - hopefully someone
can point me in the right direction.

I have created an application that has several functions that must be run by
a scheduled task (at 6am, 630, 7am, 1130, 230pm). In addition to the
scheduled tasks, users - really just a single user - need to be able to go in
and enter data and run reports.

How can I set up my app so that the macro security message does not come up?
This is imperative for the scheduled tasks to run - if the message comes up,
the task won't run. I have tried signing the app with self cert; this works
UNTIL the other user goes in and runs something. After she closes the app,
neither of us can get in because we get the message regarding the signature
being removed.

From what I can gather, the reason that the signature gets removed is
because something has changed in the app - either action queries, code, or
something else that could become malicious. Well, it's definately NOT code
that is getting changed, but it is likely an action query or 2 that I rewrite
the sql for on the fly (this is necessary).

Any suggestions?
 
So, I think I have something that might work, if someone could tell me how to
pass a command line variable with the code. From the Help files in Access
under automationsecurity create the following script:

Const cDatabaseToOpen = "path\App_name.mdb"

On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If Val(AcApp.Version) >= 11 Then
AcApp.AutomationSecurity = 1 ' msoAutomationSecurityLow
End If
AcApp.Visible = True
AcApp.OpenCurrentDatabase cDatabaseToOpen
If AcApp.CurrentProject.FullName <> "" Then
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & cDatabaseToOpen & "'."
End If


How do I add a command line variable with the call to open the database?

This will enable the bypass of the security message for my automated tasks -
the user will still have to click ok to enter the app, but I'm ok with that.
 
Back
Top