thanks Tom
I am a newbie at .vbs / .bat
the MS Access .vbs works all the time its a simple code
Dim oAccess
Dim oWorkspace
Set oAccess = CreateObject("Access.Application")
oAccess.OpenCurrentDatabase "Z:\FolderName\MSAccessDBName.accdb"
oAccess.DoCmd.RunMacro "macroName"
oAccess.CloseCurrentDatabase
oAccess.Quit
this is the excel one which is intermittently working eg: this morning failed to work yesterday worked ?
RunMacro
Sub RunMacro()
dim xl,path,xlBook
Set xl = CreateObject("Excel.application")
Set xlBook = xl.Workbooks.Open (path & "z:\FileName\workbookname.xlsm", 0, False)
path = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
xl.Application.Visible = True
xl.DisplayAlerts = False
xl.Activeworkbook.RefreshAll
xl.ActiveWorkbook.Save
xl.Activeworkbook.RefreshAll
xl.ActiveWorkbook.Save
xl.ActiveWindow.close
Set xlBook = Nothing
xl.Quit
Set xl = Nothing
End Sub