| |
azizrasul
Posts: 2
Score: 0
Joined: 9/18/2008
Status: offline
|
I have the following VB script which works nearly right to the end. Set objShell = CreateObject("WScript.Shell") objShell.Run "K:\Tips\ClickYes.exe -activate" Set objShell= Nothing rem OpenDatabase has the following arguments: - rem OpenDatabase(dbname, options, read-only, connect) Dim dbs Dim strDatabaseName Dim strMacro strMacro = "mcrTheatreSessionUtilisationandActivity" strDatabaseName = "\\stg1nas02\Information\Routine\Information Reports\Inpatients\Theatres Performance Audit Front End.mdb" Set objAccess = CreateObject ("Access.Application") With objAccess 'This temporarily changes the macros security to low to avoid messages. Only works with Access 2000 onwards. If.syscmd(7) >= 10 Then .AutomationSecurity = 1 End if .Visible = True Set dbs = .DBEngine.OpenDatabase(strDatabaseName, False) .OpenCurrentDatabase strDatabaseName .Usercontrol = True .DoCmd.RunCommand 10 'acCmdAppMaximize .DoCmd.RunMacro strMacro .CloseCurrentDatabase .Quit End With Set objAccess = Nothing dbs.Close Set dbs = Nothing Set objShell = CreateObject("WScript.Shell") objShell.Run "K:\Tips\ClickYes.exe -suspend" Set objShell= Nothing However I get an error 'You attempted to open a database that is already opened exclusively by user 'Admin' on machined 'mymachine'. Try again when the database is available'
_____________________________
Aziz
|
|