Solved

Script to switch between webpages doesn't update pages (reruns the old pages)

Posted on 2008-10-23
5
402 Views
Last Modified: 2013-12-04
Hi!

I have made a script to switch between websites after an x time, no is the problem that it displays the webpages but does not update them, i get the same page every time and i want a refreshed one.

(i already tried onload tag)

As you see in the code i have put in 2 websites, the first run it will get those websites, but when it loops it doesn't refresh..

Anyone??
On Error Resume Next
'Script by R. Laterveer
'JMS AUTOMATISERING
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Fullscreen=true   
objExplorer.TheaterMode=true                                        
objExplorer.TheaterMode=false  
objExplorer.Toolbar=false                                                               
 
do 
 
 
objExplorer.Navigate "www.google.nl" 
objExplorer.Visible = 1 
 
 
Wscript.Sleep 10000 
 
objExplorer.Navigate "www.nu.nl"  
objExplorer.Visible = 1 
 
 
Wscript.Sleep 10000 
 
loop until objExplorer.Visible = 0

Open in new window

0
Comment
Question by:Dutchict
  • 3
  • 2
5 Comments
 

Author Comment

by:Dutchict
ID: 22786399
Hi guys, i tried this;

objExplorer.Navigate "http://dir-helpdesk/jos/rdPage.aspx?&rdReport=JOS_panel" 'doel waar het script naartoe gaat  
objExplorer.Visible = 1 'betekend dat het scherm open en zichtbaar is
objExplorer.Location.Reload(True)

but this also won't work, it get's the pages ones and just show that same page every time, no updates.
I really need this script to work help!
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 22793938
You should set the expiration time to a few seconds, or otherwise tell the btowser to not use the cache.
0
 

Author Comment

by:Dutchict
ID: 22794039
DanRollins,

Thanks for the advice, but i need to do this in vbscript way, so from within the script.
So i need a line or to clear the cache every run or to get the page directly from the server bypassing the cache.

Can you help with that?

Ro
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 22794275
If you can change the script on a page, you can typically change other things in the page, such a meta-tags and headers.  Is that not the case here?
If you can chenge the headers, then send these:
    Cache-Control: no-cache
    Pragma: no-cache
    Expires: -1
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 500 total points
ID: 22794290
See the syntax for the
    Navigate Method:
    http://msdn.microsoft.com/en-us/library/aa752093(VS.85).aspx
Note he final parameter allows you to send additional headers
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Automatic Email Reminder 4 58
MS SQL Update query with connected table data 3 41
Need visual basic script to delete desktop icon 7 24
Everything left of comma in excel 4 45
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question