Solved

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

Posted on 2008-10-23
5
406 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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

628 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