Object required Error in HTA

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
Posts: 1
Joined: Thu Aug 31, 2006 3:22 am

Object required Error in HTA

Post by wasodg2 » Fri Jul 27, 2007 6:55 am

I have an HTA that installs printers on a print server with specific settings using the Prnadmin.dll.

The HTA used to work fine, so I'm not sure what has happend but I now get an error I cannot get rid of.

I use a popup window to display progress of the HTA as it lists printer drivers and other progress, with the following code.

Set ProgressWindow = window.Open("about:blank","Progress_Window","height=300,width=400,left=50,top=50,status=no,titlebar=no,SYSMENU=yes,toolbar=no,menubar=no,location=no,scrollbars=yes") ProgressWindow.Focus() ProgressWindow.document.body.style.fontFamily = "Tahoma" ProgressWindow.document.body.style.fontSize = "10pt" ProgressWindow.document.title = "Create Shared printer progress" ProgressWindow.document.body.style.borderStyle = "none" ProgressWindow.document.body.style.marginTop = 15

I have this type of code in the HTA about three times but I'll get the error now after I've entered all the information in the HTA, and clicked the button.

The error states line 111 Object required 'ProgressWindow.Document.Body' but just a few lines above it hte object is declared. So I am at a loss.


Posts: 14136
Joined: Tue May 22, 2007 9:57 am

Object required Error in HTA

Post by jvierra » Sat Aug 04, 2007 3:00 am

You canot address a popup like a normal window. It is a light-weight window without an addressable body. YOu can create a po9pup and kill it but anything else will likely ail.

Popup does not support all HTL objects such as "input". and "select".