Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21324

Problems with IF statement in Reflections for UNIX

$
0
0
Hi All

I am trying to write a VBA macro for use in Reflections for UNIX.

Here is the code:

Code:

    Dim COO As String 
    COO = InputBox("Origin that is duty free") 
    Dim COM As String 
    Dim Duty As String 
    COM = .GetText(CursorRow, CursorColumn - 5, CursorRow, CursorColumn - 3) 
    Duty = .GetText(CursorRow, CursorColumn + 2, CursorRow, CursorColumn + 4) 
   
    If COM = COO And Duty > 0 Then 
    .Transmit "Q" 
    Else 
    .Transmit "N" 
    End If

It looks like it should work fine, but it doesnt.

I have confirmed that the .GetText parts work and does in fact create strings of the selected text based on the cursors position.

I think it breaks down in the IF statement, no matter what I do it always returns "N", even with all the conditions for "Q" are met. I have even tried to remove the Duty > 0 part, leaving just COM = COO. But it still returns "N".

I'm guessing it doesn't match the inputed value (COO) with what it reads in COM even when they should be identical?

Any help would be greatly appreciated.

Viewing all articles
Browse latest Browse all 21324

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>