win7 and excel 2007 vba

dantheman9

Board Regular
Joined
Feb 5, 2011
Messages
175
so i still can't find any information about this anywhere.
I have a vba addin that was make in excel 2007 on xp, everything there works fine.
however on win7 it seems not to work (a public variable is not maitained) and so the code breaks.
the code issues are around starting and refreshing an instance of internet explorer, i have tried it with both ie8 and ie9, to the same results and error.
the code that is the problem is as follows;

Code:
Public Browser As Object

Sub detectedfile()
With Browser
.refresh  ' error here (runtime error) client connection lost?
End With
End Sub
 
Public Sub Watchon()
' Active via starting result watch
Dim WebPageDirectory As String
Dim ppt As Object
State = "Mointoring Folder..."
If Userform1.htmloption = True Then
If Dir(Environ("appdata") & "\Race Creator\Temp.htm") = "" Then
WebPageDirectory = Environ("appdata") & "\Race Creator\Temp.htm"
Else
WebPageDirectory = Environ("appdata") & "\Race Creator\Temp.htm"
End If
OpenBrowser WebPageDirectory
End Sub()
 
Function OpenBrowser(tmpURL)
Set Browser = CreateObject("InternetExplorer.Application")
Browser.Navigate (tmpURL)
Browser.Addressbar = False
Browser.StatusBar = False
Browser.Toolbar = False
Browser.MenuBar = False
Browser.Resizable = True
Browser.Visible = True
End Function

the code is started from a call to watchon from another module, and returns to that point after running through the function to start internet explorer.
setting a watcher on Browser Object, it seems ok up untill the function has ended, then it gets reset to null value...so when the refresh runs it has no track to the Browser in question.
Anyone some ideas on this?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,224,566
Messages
6,179,555
Members
452,928
Latest member
101blockchains

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top