Ok I did that and it still gives me the same error.
Main Topics
Browse All TopicsHello Experts:
I'm trying to execute a vbscript on my aspx page. Whenever I load the page it performs all the code-behind routines just fine but gives me a script error: Type mismatch: 'Print_Page'
Is there some code error here causing this? Here's the page:
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
jay-are,
In this case the Wscript is only being used to pause script execution, but this won't work in the browser. Maybe the code you got was from a .vbs file or other where this would have worked.
You will need to use some sort of workaround sleep technique for the browse/client side, the window.setTimeOut() method would work but requires the code be split in two, see example
Sub DoSomething
'main function doing some work that needs to pause
idTimer = window.setTimeout("FinishA
End Sub
Sub FinishAfterTwoSecondPause
' the code now continues along...
window.clearTimeout(idTime
End Sub
.
Here is a similar thread regarding the Sleep method and some solutions
http://www.experts-exchang
Yeah that seems to get past the type mismatch error. Now I'm stuck on: ActiveX component cant create object: 'GetObject'"
I assume I don't have something setup properly on my machine? I've tested it locally and remotely on my machine and I get the error both ways. I followed these steps:
http://www.lewisroberts.co
Any ideas?
I got it working...mostly! I added my website as a "trusted site" and then changed the security settings for trusted sits to enable "Initialize and Script ActiveX controls not marked as safe". This changes the default printer to the DYMO printer (attached to my machine) and then prints the page without any user interaction. Problem is that it won't change the deafualt back to my previous default printer...Any idea there?
Got it all working!
idTimer = window.setTimeout("FinishA
FinishAfterTwoSecondPause(
--------------------------
end function
Sub FinishAfterTwoSecondPause
' the code now continues along...
window.clearTimeout(idTime
End Sub
This allows the print to happen and then it sets the printer back to my original default. I'm so glad I'm past this issue! Thanks for all the help.
Business Accounts
Answer for Membership
by: rodnexPosted on 2008-07-11 at 11:45:06ID: 21984894
jay-are,
6,1,null,null
By placing this code outside of a sub and having it execute inline, I was able to see that an error is thrown because of the paranthesis around the WebBrowser1 call, cannot use parans when calling a sub.
Try removing the parans as seen below, hope this solves your problem or allows you to debug it further.
WebBrowser1.ExecWB
rodnex