I think below will solve your problem, Please try and let me know the results,
function updateExcel(fileName, sheetName, arrayStartDate, arrayEndDate) {
var book;
var filepath = Project.Path + fileName;
var app1 = Sys.OleObject("Excel.Application");
app1.DisplayAlerts = false;
var curSecurityValue = app1.AutomationSecurity;
app1.AutomationSecurity = 3; //refer https://msdn.microsoft.com/en-us/library/aa432468(v=office.12).aspx
book = app1.Workbooks.Open(filepath);
var sheet = book.Sheets(sheetName);
var rowCount = sheet.UsedRange.Rows.Count;
Log.Message('Row Count ' + rowCount);
var j = 0;
for (var row = 2; row <= rowCount + 1; row++) {
Log.Message('Trade Start Date -- ' + arrayStartDate[j] + ', Trade End Date --' + arrayEndDate[j]);
sheet.Cells.Item(row, 7).Value = arrayStartDate[j];
sheet.Cells.Item(row, 8).Value = arrayEndDate[j];
if (row == arrayStartDate.length + 1) {
break;
}
j = j + 1;
}
book.Save();
app1.AutomationSecurity = curSecurityValue;
app1.Quit();
}
ref: https://stackoverflow.com/questions/25889742/remove-protected-view-from-excel-sheet-opened-programmatically-in-access