Quality Testing

Quality is delighting customers

How to get the bgcolor in a cell in excel using QTP tool?

Hi All,

How to get the bgcolor in a cell in excel using QTP tool? Can any one share script plz?


-Kiran

Views: 1603

Reply to This

Replies to This Discussion

Hi
Hope u can find the answer here

Set a = createobject ("excel.application")
a.visible= True
Set b = a.workbooks.open ("D:\test1.xls")
Set c = a.workbooks.open ("D:\test2.xls")
Set d = b.worksheets (1)
Set e = c.worksheets (1)
For each cell in d.usedRange
If cell.value<>e.range (cell.address).value Then
cell.interior.colorindex=3
cell.font.color = vbgreen
else
cell.interior.colorindex=5
cell.font.color = vbred
End If
Next
a.quit ' If u want to close the excel then use this syntax
Set a=nothing

http://ssofttesting.blogspot.com

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2020   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service