'''' Define the file full name. strDBFullName = "C:\Users\Charles\Documents\Weather\Weather.accdb" '''' Check whether the file exists. If Not CreateObject("Scripting.FileSystemObject").FileExists(strDBFullName) Then MsgBox "File """ & strDBFullName & """ does not exist or is not available.", vbCritical, "File Not Found" WScript.Quit End If '''' Create a new Access-instance, display it and open the file. Set oAC = CreateObject("Access.Application") oAC.Visible = True Set oDB = oAC.OpenCurrentDataBase strDBFullName ' oDB.Run "Update" '''' Opens and Runs The Auto open Macro '''' Save the workbook and clean up. oDB.Save oDB.Close oAC.Quit Set oAC = Nothing
Set oDB = oAC.OpenCurrentDataBase strDBFullName ----------------------------------^
Set oDB = oAC.OpenCurrentDataBase(strDBFullName)
OpenCurrentDatabase
oDB
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)