I have a simple VBScript that calls up MS Access, runs a macro to retrieve
data from an ODBC database, and then calls up MS Excel, and runs a macro to
format the retrieved data. This script, as listed below, runs fine if I start
it manually. It also works fine if I schedule it to run every night but with
my Windows session logged on. If I leave the machine on, but without logging
on, the VBScript will start but never end. I think it fails to start MS
Access. I do not have Admin priviledge on the computer which is running Win
XP Pro.
Is this a security related issue? How can workaround this other than trying
to gain Admin pivilege for my user account?
--
Teddy
********* Script starts below ************
Shared_Folder = "C:\RMM\Reports"
' Create Log File if it doesn't already exist
LogFilePath = Shared_FOlder & "\Mid-Week LogFile.txt"
Set oFSO = CreateObject("Scripting.FileSystemObject")
SET oLogFile = oFSO.CreateTextFile(LogFilePath, True)
oLogFile.WriteLine(LogLine)
oLogFile.WriteLine("Log File Initially Created : " &Date &" - " &Time)
oLogFile.WriteLine(LogLine)
Dim ObjAccess
Dim ObjExcel
'
' Open Access DB and run Mid_Week_Reports
'
oLogFile.WriteLine("MS Access Started: " &Date &" - " &Time)
Set ObjAccess = CreateObject("ACCESS.APPLICATION")
' ObjAccess.Visible = FALSE
ObjAccess.OpenCurrentDatabase ("c:\RMM\REPORTS\RMM Data Analysis (AUTO).mdb")
ObjAccess.Run ("RUN_Mid_week")
ObjAccess.Quit
Set ObjAccess = Nothing
oLogFile.WriteLine("MS Access Finished: " &Date &" - " &Time)
'
' Open Excel to update all traffic reports
'
oLogFile.WriteLine("MS Excel Started: " &Date &" - " &Time)
Set ObjExcel = CreateObject("EXCEL.APPLICATION")
' ObjExcel.DisplayAlerts=TRUE
' ObjExcel.Visible=TRUE
ObjExcel.Run ("'C:\RMM\REPORTS\Update All
Reports.xls'!Update_Traffic_Reports")
ObjExcel.Quit
Set ObjExcel = Nothing
oLogFile.WriteLine("MS Excel Finished: " &Date &" - " &Time)