G
Guest
I'm running the following code and get the subject message. I've enabled the
Microsoft Office 11.0 Library.
Any ideas?
' Note: This sub requires the Microsoft Office 11.0 Library
' as a Reference.
' This sub activates the Macro -> Security submenu to open
' the Macro Security dialog window for the user who is using
' the runtime version of Access '03 instead of the retail version,
' which may need to have the default security level changed in
' order to run the code in the modules.
'==============================================
Public Function openSecurityDialog()
On Error GoTo ErrHandler
Dim CmdBar As CommandBar
Dim CmdBarPopup As CommandBarPopup
Set CmdBar = Application.CommandBars("Menu Bar")
Set CmdBarPopup = CmdBar.Controls("Tools")
Set CmdBarPopup = CmdBarPopup.Controls("Macro")
CmdBarPopup.Controls("Security...").Execute
CleanUp:
Set CmdBarPopup = Nothing
Set CmdBar = Nothing
Exit Function
ErrHandler:
MsgBox "Error in openSecurityDialog( )" & vbCrLf & _
"in SecurityFunctions module." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description
Err.Clear
GoTo CleanUp
End Function ' openSecurityDialog( )
Microsoft Office 11.0 Library.
Any ideas?
' Note: This sub requires the Microsoft Office 11.0 Library
' as a Reference.
' This sub activates the Macro -> Security submenu to open
' the Macro Security dialog window for the user who is using
' the runtime version of Access '03 instead of the retail version,
' which may need to have the default security level changed in
' order to run the code in the modules.
'==============================================
Public Function openSecurityDialog()
On Error GoTo ErrHandler
Dim CmdBar As CommandBar
Dim CmdBarPopup As CommandBarPopup
Set CmdBar = Application.CommandBars("Menu Bar")
Set CmdBarPopup = CmdBar.Controls("Tools")
Set CmdBarPopup = CmdBarPopup.Controls("Macro")
CmdBarPopup.Controls("Security...").Execute
CleanUp:
Set CmdBarPopup = Nothing
Set CmdBar = Nothing
Exit Function
ErrHandler:
MsgBox "Error in openSecurityDialog( )" & vbCrLf & _
"in SecurityFunctions module." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description
Err.Clear
GoTo CleanUp
End Function ' openSecurityDialog( )