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.
This topic is 16 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
wasodg2
Posts: 1
Last visit: Fri Jul 27, 2007 6:55 am

Object required Error in HTA

Post by wasodg2 »

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.

uploads/3085/install_printer.hta.txt
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Object required Error in HTA

Post by jvierra »

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".
This topic is 16 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked