I have this code:
If cells(3,11).value="c:users\flap-fis.txt"
This condition is getting failed every time either we have file location of or not.
How can I write the code how to check specific cell value with static string?
Do you know how to debug VBA projects? Best thing to do for such a case is putting a breakpoint on that particular line and use the "immediate" window, where you can ask ? <var> in order to know the value of a variable, as in these examples:
? Cells(3, 11).Value = "c:users\flap-fis.txt"
False
? Cells(3, 11).Value
c:\users\flap-fis.txt
=> Mind the extra backslash, as already mentioned by PEH.
cellesshould becells. Also specify in which worksheet this cell is eg.Worksheets("Sheet1").Cells(3, 11)Cells? Note that your path is missing a backslash ` \` right afterc:it should be"c:\users\flap-fis.txt"