Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > VBScript
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Location: Oregon
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
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:52 PM.


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