Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #11 (permalink)  
Old April 18th, 2009, 04:29 PM
Registered User
 
Join Date: Apr 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

Quote:
Originally Posted by Old Pedant View Post
Well, I'm done here. Maybe somebody else will comment.



Well, thanks for nothing. You're right, you spoke too soon and it was pointless in speaking if you aren't going to help. Take care! Soo long !!!
Reply With Quote
  #12 (permalink)  
Old December 8th, 2011, 01:47 PM
Registered User
 
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Red face Running it from an .HTA

These are some good examples here. Thanks for sharing them. I tried running the example from Inforequester from within an hta in an effort to learn more about scripting. The code produces the following error: Object required 'Wscript' . I tinkered with it for over an hour to get that error cleared to no avail. This little program/script launches Notepad and IE as expected but that's all it does.

Question # 1: Why is it producing that error?

Below is my source code:

Code:

<html> 
<head> 
<script language="VBScript">


    Sub RunProgram1 
        Set objShell = CreateObject("WScript.Shell")
        objShell.Run "notepad.exe C:\Documents and Settings\UsersName\My Documents\First_HTA_Automation_Script\ReadMe.txt"
    End Sub

    Sub RunProgram2 

	Set IE = CreateObject("InternetExplorer.Application") 
	set WshShell = CreateObject("WScript.Shell")  
	IE.Navigate "https://mysuperwebsite.com/login.jsp" 
	IE.Visible = True 
	WScript.Sleep 6000
	IE.Document.All.Item("fld_userName").Value =         "vikingMoJo@notsoeasystreet.com"
 	IE.Document.All.Item("fld_password").Value = "superPassword" 
	WshShell.AppActivate "IE" 
	WshShell.SendKeys "{ENTER}"
	
    End Sub


</script> 
</head> 

<body> 
<button onclick="RunProgram1">Launch Notepad</button> <p>
<br>
<button onclick="RunProgram2">Launch IE</button> <p>
</body> 
</html>
Question # 2: Can anybody direct me to some good online tutorials for using VBscripts from HTA's (Hypertext Applications) ??

My ultimate goal with VBscript is to automate the testing and routine tasks that I have to do with web browsers and I would like to house and launch my VBscripts from HTA's.

THANK YOU in advance.
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill out a web form mendy VB How-To 19 March 31st, 2015 02:28 PM
How to fill the IE's web page forms from VB? JohnThomas VB How-To 1 April 19th, 2009 06:53 AM
Fill datasheet/Continuous form with vba code only Galateo Access VBA 0 May 9th, 2008 09:39 AM
Which is the web site that teachs VBScript ? Hoang2005 Excel VBA 1 March 10th, 2006 08:09 AM
auto-fill form crmpicco HTML Code Clinic 2 April 21st, 2005 06:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.