Script to open Access database, run macro, and persist Access instance
If you want to leave the application open after the script completes you need to set the UserControl
property to true
.
dim accessAppset accessApp = createObject("Access.Application")accessApp.visible = trueaccessApp.UserControl = trueaccessApp.OpenCurrentDataBase("C:\path.accdb")accessApp.Run "myLinker"
The Visible
property is technically unnecessary when the UserControl
property is true. It will automatically be set.
More information here: http://msdn.microsoft.com/en-us/library/office/ff836033.aspx