I have Excel 2010. The following vbscript file is executed by a scheduled task. It opens a file to update it, save and close. The file has the "read-only recommended" option on and my script must answer this prompt with "no" which is not the default.
Set objXL = WScript.CreateObject("Excel.Application")
.DisplayAlerts = False
.WorkBooks.Open FileName:="S:\Schedule\EngDates.xlsm", ReadOnlyRecommended:=False, IgnoreReadOnlyRecommended:=True
.DisplayAlerts = TRUE
.Visible = TRUE ' Optional
Set objXL = Nothing
I have tried several different syntax formats, with and without parentheses, and nothing has worked yet.
When I run this script, I get an error as seen in the attached file. Does anyone see the problem with my syntax?