Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-10-23
5
Medium Priority
?
409 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
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…
Suggested Courses

730 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