I am very new to using script . i was hoping someone could help me .
I want to write a client side web page that will start excel on client computer and upon a button click javascript will open the excel file from c drive and display output .
I have been able to start excle using "how to automate excel from a client side javascript"
I have been searching google / javascript tutorial sites and found another script(vbscript) on different forum.I want to delete all rows except for the total amount.
I want to be able to use two/three more words like 'total cost' 'gross receipt' in the script.can someone please help me how to do it using javascript

Set appExcel = CreateObject(“Excel.Application”)
Set objWorkBook = appExcel.Workbooks.Open (“C:\Users\Desktop\Book1.xls”) ‘opens the sheet
Set objSheet = objWorkBook.Sheets(“Sheet1?) ‘ To select particular sheet

Set A =  objSheet.UsedRange.Find (total amount) ‘ data to find

For each A in objSheet.UsedRange ‘ Loop through the used range
If A   =    total amount    then ‘ compare with the expected data
c.Interior.ColorIndex = 10 ‘ make the gary color if it finds the data
End If
Set A =  objSheet.UsedRange.FindNext(A) ‘ next search

set appExcel=nothing

End Function
6 Years
Discussion Span
Last Post by twiss

Does this code work for you? If so, is the question how to port this to javascript? You can, but you will need ActiveXObject which works only in IE.


Hi permalink
Thank you again ,the code works fine,i know little about ActiveXObject ,but i can get it to work .


Haha, I'm not permalink. Permalink means a link that will always point to the post. The user names are on the left, mine is twiss.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.