VbScript on Server 2008
I am having a problem running a vbscript on Server 2008. It used to work till I modified the script. The scripted works great manually and produces the correct end result.
Background: Script runs opens excel and updates all sheets from a connection to a database, and saves the file.
Script attached here:
Dim objExcel, objWorkbook
Set objExcel = CreateObject("Excel.Application")
strPathExcel = "\\XXXXX\"
strFile = "KPI Daily Report"
strSaveFile = strPathExcel & strFile
objExcel.Visible = True
objExcel.Workbooks.open (strPathExcel & strFile & ".xlsx")
WScript.Sleep 10000 ' Waiting as refresh may take upto ten seconds
objExcel.ActiveWorkbook.SaveAs strSaveFile & "_" & Year(Now) & "-" & Month(Now) & "-" & Day(Now) & ".xlsx"
Set objWorkbook = Nothing
Set objExcel = Nothing
Here are my Task scheduler settings:
Run whether user is logged on or not, and Run with Highest Privileges. User account is domain admin.
Configured for Server 2008
Action-Start a program
Just looking for any help in making this task complete. All ODBC Drivers are installed on the server for System and User DSN as it need that to run manually.
Add Argument (Optional)-"C:\KPI Board Reporting.vbs"
Be the first to answer this question