1

I have been trying to learn Web Scraping using VBScript since VBA for Outlook does not work like VBA for Excel

So I am trying to display a message box to see whether or not my script is getting to specific points. I can display the first message box but not the second one. I understand that it is due to the line wscript.quit but I need that line otherwise I can't open IE.

Msgbox ("hello"),0,("title") set Shell = createobject("wscript.shell") Shell.Run "google.ca" wscript.quit

DIM IE Set IE = CreateObject("IExplorer.exe")

Msgbox ("hello"),0,("title")

All help is appreciated, Thanks.

Sheldon
  • 11
  • 3
  • 3
    You seem to be asking "how do I execute VBScript after I have stopped executing VBScript?" You might as well ask "how can I keep sleeping after I wake up?" – John Coleman Jul 07 '17 at 18:19
  • Is that seriously what I was asking?!?! I had no idea! If that's the case then why does Internet Explorer still open? – Sheldon Jul 07 '17 at 18:29
  • 1
    Presumably `Shell.Run "google.ca"` opens it up. – John Coleman Jul 07 '17 at 18:31
  • Yup! You were right! I just changed it so that it no longer uses the shell to run. – Sheldon Jul 07 '17 at 19:19
  • Your question was how do you open a Msgbox after executing Wscript.Quit. You can't. The lines you have after the quit command are never executing. If you want to run them move the quit. – RLH Jul 13 '17 at 01:00
  • OK thanks. BTW how do I mark this question as answered? I couldn't find it in the FAQs – Sheldon Jul 14 '17 at 12:53
  • @Sheldon In this case, John could've posted an answer instead of a a comment and then you could have accepted it. Now, you can either answer your own question by repeating the above, and then mark it as accepted, or you could ask John to rewrite his comment as an answer, or you can delete your question. Since you're new, I'd recommend the first or second one. – BoffinBrain Aug 15 '17 at 09:32

0 Answers0