Bry Man
03-21-2005, 11:51 PM
Hey,
Im making a program that has a feater that it is supposed to be able to pull a username out of a sentance in an online document, ive done searches on google on how to do this but it was never what I needed or It never worked. I talked to a guy who knew about what I was doing and he gave me the following code, this SHOULD be able to pull the name ShadowSlider out of the following sentance according to him.
As ShadowSlider's army runs from the . . .
dim begin,last
dim attack
begin=instr(1,html,"As")+3
last=instr(1,html,"'s army runs from the")-3
attack=mid$(html,begin,last-begin)
Text1.text=attack
When I place this into a a command button and have it scan a IE window that it opens it gives me the following error
Run-Time Error 5
Invalid procedure call or argument
and then highlights this line
attack = Mid$(html, begin, last - begin)
If anyone can help me that'd be great cuz im unsure of how to fix this as the guy never really explained how the code did what it was intended to do.
Im making a program that has a feater that it is supposed to be able to pull a username out of a sentance in an online document, ive done searches on google on how to do this but it was never what I needed or It never worked. I talked to a guy who knew about what I was doing and he gave me the following code, this SHOULD be able to pull the name ShadowSlider out of the following sentance according to him.
As ShadowSlider's army runs from the . . .
dim begin,last
dim attack
begin=instr(1,html,"As")+3
last=instr(1,html,"'s army runs from the")-3
attack=mid$(html,begin,last-begin)
Text1.text=attack
When I place this into a a command button and have it scan a IE window that it opens it gives me the following error
Run-Time Error 5
Invalid procedure call or argument
and then highlights this line
attack = Mid$(html, begin, last - begin)
If anyone can help me that'd be great cuz im unsure of how to fix this as the guy never really explained how the code did what it was intended to do.