Unexpected ‘Next’ or Unexpected ‘End If’
Actually I also not too sure about it, but I find a stupid way to “fix” this error. Why I say that is a stupid solution? After you finish reading my blog then I think you should think that is funny as well.
Please look at the screenshot, after I completed the script and try to save, the QTP prompt me that there is an error (Unexpected ‘Next’, sometime happen in ‘End If’).

Then I remark the “For loop” and save the script. No error generated.

After the script saved, I enable the For loop by removing the remark, then save the script again.

Amazing! The script can be saved which is totally same as previously. This was also “unexpected” for me.
If someone know the reason , please post to share your learning so that whoever view this post will gain some knowledge. Thanks and enjoy.
Custom Search
































