Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Operator mismatch
Message
From
23/05/2010 08:44:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
23/05/2010 05:31:53
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01465616
Message ID:
01465622
Views:
49
Get the value into a separate variable first, then compare with the variable. If you get the error, check the type. It is quite possible that the cell has a different data type, even if it looks like numeric.

>I am using this code snippet below and getting the operator/operand type mismatch error for
>this part:
>
>oExcel.Cells[nRow, 8].Value <= 3.2".
>
>
>code snippet:
>
>FOR nRow = 1 TO  oExcel.ActiveWorkBook.ActiveSheet.UsedRange.Rows.Count
>      IF (oExcel.Cells[nRow, 2].Value = "eseti" AND oExcel.Cells[nRow, 8].Value <= 3.2)
>       	    oExcel.Cells[nRow, 2].Interior.Color = RGB(255,153,255)
>      ENDIF
>ENDFOR
>
>
>Can anyone help?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform