06-02-2011 01:05 PM
I know this is possible inside of excel but I was wondering if there is a VBScript that will allow me to check a cell inside of excel and return it's interior colorIndex?
06-03-2011 04:14 PM
Hi aGrimm,
You can also get the color with VBScript in DIAdem! The color returned will be a number, but you can then handle the number to get a color name or whatever else you need to do.
Here is the code I used to test this is:
Dim objExcel, objWorkbook
Dim strFileName
Dim CI
strFileName = "C:\Users\bvaughan\Documents\TestBook.xls"
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(strFileName)
CI = objExcel.Worksheets("Sheet1").Cells(1, 1).Interior.ColorIndex
MsgBox(CI)
Regards,
Brandon V.
Applications Engineering
National Instruments