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
Thanks

Set appExcel = CreateObject(“Excel.Application”)
appExcel.visible=true
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
next

objWorkBook.save
objWorkBook.close
set appExcel=nothing

End Function

Recommended Answers

All 3 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.