deleting a row in excel worksheet using Javascript ActiveX Excel Object

Im opening an excel worksheet and adding data to it using Javascript ActiveX Excel Object with the code below.
In the code the column A in excel worksheet will have a unique value.
I need to delete the entire row matching the value in column A and shift the
rest of the rows up using this Javascript ActiveX Excel Object.

Please help me with the solution
var Excel,Book;
Excel = new ActiveXObject("Excel.Application");
Book = Excel.Workbooks.Open("c:/example.xls");
var excel_sheet = Book.Worksheets("Sheet1");
Excel.Visible = false;
var i=1;
excel_addsheet.Cells(i,1).Value = i;
excel_addsheet.Cells(i,2).Value = "text1"
excel_addsheet.Cells(i,3).Value = "text2"
excel_addsheet.Cells(i,4).Value = "text3"

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Call the Delete method on a row in the worksheet:
var excel = new ActiveXObject('Excel.Application'),
  book = excel.Workbooks.Open('C:\\Example.xlsx'),
  worksheet = book.Worksheets('Sheet1'),
  i = 1;
// excel.Visible = false; // false is the default (for me anyway)
while (worksheet.Cells(i, 1).Value !== undefined) {
  worksheet.Cells(i, 1).Value = i;
  worksheet.Cells(i, 2).Value = 'text1';
  worksheet.Cells(i, 3).Value = 'text2';
  worksheet.Cells(i, 4).Value = 'text3';
// book.Save(); // this would not work for me, so...

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
accetdineshAuthor Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.