NisHera
8 years agoValued Contributor
Writing to excel compatible files
Hi,
My application creates a excel report in old version 97-2003 work sheet.
to run the test I need to add couple of line into it.
The new test machine has Excel 2016.
I used to open and write using ..
var app = Sys.OleObject("Excel.Application")
var book = app.Workbooks.Open(fname);
var sheet = book.Sheets(sheetName);
..............
app.Visible = true;
xlRange = app.Range('A1').Activate();
app.ActiveCell.EntireRow.Insert(); //.Insert();
for(i=1;i<18;i++){ app.Cells(1,i)= headVal[i] }
.....................
book.Save();
Delay(7000);
app.Quit();
But now it doesn't work.
Opens in compatibility mode, can see writing (many lines ...) but discarded while saving.
any solutions?
It was my silly mistake..
Code is working perfectly...
it was parameter "fname" missing a '\' inside