True = True condition failing

ragha81

New Member
Joined
Feb 15, 2008
Messages
4
Hi Excel Gurus,

I have an "If" condition that if its evaluated to "True', execute something anf if it doesn't do something else but even though the if condition is True it always goes to Else condition

Code:
   SareUSure = MsgBox("Do you want to start loading LOV?", vbYesNo)
    If SareUSure = vbYes Then
        Set oSiebelApp = CreateObject("TWSiebel.SiebelWebApplication.1")
        Set oLOVBO = oSiebelApp.GetBusObject("List Of Values")
        Set oLOVBC = oLOVBO.GetBusComp("List Of Values")
        Set vWorksheet = ThisWorkbook.Worksheets("LoadLOV")
        Set vObject = vWorksheet.[A2]
        While Trim(vObject.Offset(RowCount, 0).Value) <> ""
       ' oLOVBC.ActivateField ("Type")
        'oLOVBC.ActivateField ("Order By")
        oLOVBC.SetViewMode AllView
        oLOVBC.ClearToQuery
       
       oLOVBC.SetSearchSpec "Type", "'" + Trim(vObject.Offset(RowCount, 0).Value) + "'"
       oLOVBC.SetSortSpec "DESC"
       oLOVBC.ExecuteQuery ForwardBackward
       isRecord = oLOVBC.FirstRecord
       If isRecord = True Then
       iLastOrderBy = oLOVBC.GetFieldValue("Order By")
       Else
       GoTo CreateNewLOV
       End If

Please see the watch window below. The variable isRecord is infact "True" but it wont evaluate to True

Watch : : isRecord : True : Boolean : Module1.LOVUpdate

Thanks,
Raghav
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top