Hi,
I have an VBscript which opens a Access db and loads the imported data from two excel sheets and runs few action queries in the frmDone event.
The issue is when i run the script, it executes the excel actions but fails to open the database. But this is random since when i try to run the script again, the database opens and executes the action in frmDone.
Recently, they re-imaged my machine but with the same office setup (Office365). I am not sure if this why this issue is occurring since after repeated tries, the script executes.
correctly.
TIA
I have an VBscript which opens a Access db and loads the imported data from two excel sheets and runs few action queries in the frmDone event.
The issue is when i run the script, it executes the excel actions but fails to open the database. But this is random since when i try to run the script again, the database opens and executes the action in frmDone.
Recently, they re-imaged my machine but with the same office setup (Office365). I am not sure if this why this issue is occurring since after repeated tries, the script executes.
correctly.
Code:
Set objExcel = Nothing
Dim db ''As DAO.Database
Dim ac ''As Access Application
Set ac = CreateObject("Access.Application")
ac.OpenCurrentDatabase("C:\access\perfdata_fe.accdb")
set shl = createobject("wscript.shell")
shl.sendkeys "^{F4}"
set db = ac.CurrentDB
ac.docmd.openform "frmDone"
'ac.docmd.closeform "frmDone"
'appAccess.DoCmd.Close 3, cstrReport ' acReport = 3
'appAccess.Quit
'Set appAccess = Nothing
else
WScript.Echo "Import Aborted."
wscript.quit
End if
' ac.docmd.closeform "frmDone"
'ac.DoCmd.Close 3, cstrReport ' acReport = 3
ac.Quit
Set ac = Nothing
WScript.Echo "Import Complete."
wscript.quit
TIA