Link to home
Start Free TrialLog in
Avatar of accetdinesh
accetdineshFlag for India

asked on

deleting a row in excel worksheet using Javascript ActiveX Excel Object

Hi,
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;
while(excel_addsheet.Cells(i,1).Value!=null)
{
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"
i++;
}
Book.Save;
Application.Excel.Quit();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of GregTSmith
GregTSmith

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of accetdinesh

ASKER

Thank you!