Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Refresh a local web page via Excel

Hi again

A couple of weeks ago I asked if there was a command to refresh a web page
on a local drive

As I gave very little detail I don't think that anybody understood my
request :(
I will now try to clarify
Using Excel 2002 on Vista

Purpose:
The program puts certain details on a sheet which is published as a local
web page and, using Extended Desk-top, is projected onto a large screen
The detail on the sheet is frequently updated and the wish is for the
projected page to update (refresh) automatically. Currently the user has to
go to the page and press F5

I will describe the full set of relevant code

'I have a function to launch a web page using IE:

Public Browser As Object

Function OpenBrowser(tmpURL)
Set Browser = CreateObject("InternetExplorer.Application")
Browser.Navigate (tmpURL)
Browser.Addressbar = False
Browser.StatusBar = False
Browser.Toolbar = False
Browser.MenuBar = False
Browser.Visible = True
Browser.Resizable = True
End Function

'I then start the program opening IE with the specified web page :

Dim WebPageDirectory As String
WebPageDirectory = Range("My_Directory") & "\page.htm"
'Using the function called OpenBrowser
OpenBrowser WebPageDirectory

'In another routine on a form these lines redraw the page

MyAdd = Range(Cells(1, 1), Cells(NumberTablesRows + 1, NumberTablesColumns +
1)).Address
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSo urceRange,
Filename:=Range("My_Directory") & "\page.htm", Sheet:="Venue",
Source:=MyAdd, HtmlType:=xlHtmlStatic)
.Publish (True)
.AutoRepublish = True
End With
Up to here it all works well

At this point I need Excel to refresh the Page.htm with a command using
something like (one of) the following :
With Browser
.Republish
.Publish
.Refresh
End With
Unfortunately all of the above commands give me error 91 - "Object variable
or With Block variable not set"

I wondered whether there is a command that will refresh (F5) the web page?

Thanks in advance
--
Regards,
Peter Bircher

Cell : 083 233 1628
Email:

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Refresh a local web page via Excel

The error tells you that the public variable (Browser) must have been
destroyed by some of your code (or maybe even it resides in a
different VBA project alltogether.
Without seeing the resto of the code it's hard to tell which bit of
your code actually destroys the variable.

On Feb 25, 10:54*am, "Pete" wrote:
Hi again

A couple of weeks ago I asked if there was a command to refresh a web page
on a local drive

As I gave very little detail I don't think that anybody understood my
request :(
I will now try to clarify
Using Excel 2002 on Vista

Purpose:
The program puts certain details on a sheet which is published as a local
web page and, using Extended Desk-top, is projected onto a large screen
The detail on the sheet is frequently updated and the wish is for the
projected page to update (refresh) automatically. *Currently the user has to
go to the page and press F5

I will describe the full set of relevant code

'I have a function to launch a web page using IE:

Public Browser As Object

Function OpenBrowser(tmpURL)
Set Browser = CreateObject("InternetExplorer.Application")
* * Browser.Navigate (tmpURL)
* * Browser.Addressbar = False
* * Browser.StatusBar = False
* * Browser.Toolbar = False
* * Browser.MenuBar = False
* * Browser.Visible = True
* * Browser.Resizable = True
End Function

'I then start the program opening IE with the specified web page :

Dim WebPageDirectory As String
WebPageDirectory = Range("My_Directory") & "\page.htm"
'Using the function called OpenBrowser
OpenBrowser WebPageDirectory

'In another routine on a form these lines redraw the page

MyAdd = Range(Cells(1, 1), Cells(NumberTablesRows + 1, NumberTablesColumns +
1)).Address
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSo urceRange,
Filename:=Range("My_Directory") & "\page.htm", Sheet:="Venue",
Source:=MyAdd, HtmlType:=xlHtmlStatic)
* * *.Publish (True)
* * *.AutoRepublish = True
End With
Up to here it all works well

At this point I need Excel to refresh the Page.htm with a command using
something like (one of) the following :
With Browser
* * .Republish
* * .Publish
* * .Refresh
End With
Unfortunately all of the above commands give me error 91 - "Object variable
or With Block variable not set"

I wondered whether there is a command that will refresh (F5) the web page?

Thanks in advance
--
Regards,
Peter Bircher

Cell : * *083 233 1628
Email:


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Refresh a local web page via Excel

Ok. Thanks, AB I will check it out

But what I want to know is will this actually work?
With Browser
.Refresh
End With

If not, what is the equivalent fo pressing F5 in the browser itself?

--
Regards,
Peter Bircher

AutomateXcel
http://www.automatexcel.co.za/index.html

Cell : 083 233 1628
Email:

"AB" wrote in message
...
The error tells you that the public variable (Browser) must have been
destroyed by some of your code (or maybe even it resides in a
different VBA project alltogether.
Without seeing the resto of the code it's hard to tell which bit of
your code actually destroys the variable.

On Feb 25, 10:54 am, "Pete" wrote:
Hi again

A couple of weeks ago I asked if there was a command to refresh a web page
on a local drive

As I gave very little detail I don't think that anybody understood my
request :(
I will now try to clarify
Using Excel 2002 on Vista

Purpose:
The program puts certain details on a sheet which is published as a local
web page and, using Extended Desk-top, is projected onto a large screen
The detail on the sheet is frequently updated and the wish is for the
projected page to update (refresh) automatically. Currently the user has
to
go to the page and press F5

I will describe the full set of relevant code

'I have a function to launch a web page using IE:

Public Browser As Object

Function OpenBrowser(tmpURL)
Set Browser = CreateObject("InternetExplorer.Application")
Browser.Navigate (tmpURL)
Browser.Addressbar = False
Browser.StatusBar = False
Browser.Toolbar = False
Browser.MenuBar = False
Browser.Visible = True
Browser.Resizable = True
End Function

'I then start the program opening IE with the specified web page :

Dim WebPageDirectory As String
WebPageDirectory = Range("My_Directory") & "\page.htm"
'Using the function called OpenBrowser
OpenBrowser WebPageDirectory

'In another routine on a form these lines redraw the page

MyAdd = Range(Cells(1, 1), Cells(NumberTablesRows + 1, NumberTablesColumns
+
1)).Address
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSo urceRange,
Filename:=Range("My_Directory") & "\page.htm", Sheet:="Venue",
Source:=MyAdd, HtmlType:=xlHtmlStatic)
.Publish (True)
.AutoRepublish = True
End With
Up to here it all works well

At this point I need Excel to refresh the Page.htm with a command using
something like (one of) the following :
With Browser
.Republish
.Publish
.Refresh
End With
Unfortunately all of the above commands give me error 91 - "Object
variable
or With Block variable not set"

I wondered whether there is a command that will refresh (F5) the web page?

Thanks in advance
--
Regards,
Peter Bircher

Cell : 083 233 1628
Email:


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default Refresh a local web page via Excel

That's the construct i'm using to refresh browser instances - and it
works in my code.



On Mar 2, 3:05*pm, "Pete" wrote:
Ok. *Thanks, AB *I will check it out

But what I want to know is will this actually work?
*With Browser
* * * .Refresh
*End With

If not, what is the equivalent fo pressing F5 in the browser itself?

--
Regards,
Peter Bircher

AutomateXcelhttp://www.automatexcel.co.za/index.html

Cell : * *083 233 1628
Email:

"AB" wrote in message

...
The error tells you that the public variable (Browser) must have been
destroyed by some of your code (or maybe even it resides in a
different VBA project alltogether.
Without seeing the resto of the code it's hard to tell which bit of
your code actually destroys the variable.

On Feb 25, 10:54 am, "Pete" wrote:



Hi again


A couple of weeks ago I asked if there was a command to refresh a web page
on a local drive


As I gave very little detail I don't think that anybody understood my
request :(
I will now try to clarify
Using Excel 2002 on Vista


Purpose:
The program puts certain details on a sheet which is published as a local
web page and, using Extended Desk-top, is projected onto a large screen
The detail on the sheet is frequently updated and the wish is for the
projected page to update (refresh) automatically. Currently the user has
to
go to the page and press F5


I will describe the full set of relevant code


'I have a function to launch a web page using IE:


Public Browser As Object


Function OpenBrowser(tmpURL)
Set Browser = CreateObject("InternetExplorer.Application")
Browser.Navigate (tmpURL)
Browser.Addressbar = False
Browser.StatusBar = False
Browser.Toolbar = False
Browser.MenuBar = False
Browser.Visible = True
Browser.Resizable = True
End Function


'I then start the program opening IE with the specified web page :


Dim WebPageDirectory As String
WebPageDirectory = Range("My_Directory") & "\page.htm"
'Using the function called OpenBrowser
OpenBrowser WebPageDirectory


'In another routine on a form these lines redraw the page


MyAdd = Range(Cells(1, 1), Cells(NumberTablesRows + 1, NumberTablesColumns
+
1)).Address
With ActiveWorkbook.PublishObjects.Add(SourceType:=xlSo urceRange,
Filename:=Range("My_Directory") & "\page.htm", Sheet:="Venue",
Source:=MyAdd, HtmlType:=xlHtmlStatic)
.Publish (True)
.AutoRepublish = True
End With
Up to here it all works well


At this point I need Excel to refresh the Page.htm with a command using
something like (one of) the following :
With Browser
.Republish
.Publish
.Refresh
End With
Unfortunately all of the above commands give me error 91 - "Object
variable
or With Block variable not set"


I wondered whether there is a command that will refresh (F5) the web page?


Thanks in advance
--
Regards,
Peter Bircher


Cell : 083 233 1628
Email: - Hide quoted text -


- Show quoted text -


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refresh a local web page Pete[_34_] Excel Programming 2 February 8th 11 12:33 PM
Export data from Excel to a local web page GS Excel Discussion (Misc queries) 0 October 23rd 09 04:04 AM
Tweaking to pull a local HTML page instead of a server page? JP[_4_] Excel Programming 0 February 20th 08 03:17 PM
Hyperlink to local PDF file page LoriM Excel Programming 0 October 17th 07 06:36 PM
open/save excel on a local web page as an activex behzad Excel Programming 0 September 15th 03 07:32 AM


All times are GMT +1. The time now is 10:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"