castertroy
New Member
- Joined
- Mar 6, 2010
- Messages
- 32
Hi,
I had a code that runs fine in Excel 2000 but now I am on Excel 2003 when I click on the button to start the macro nothing happens. I have checked the references and the Microsoft Internet Controls and HTML object boxes are ticked. Here is the code:
If I use an older PC here it works fine on Windows/Excel 2000 but for some reason it no longer runs. Does anyone have any ideas how to rectify this?
Thanks
I had a code that runs fine in Excel 2000 but now I am on Excel 2003 when I click on the button to start the macro nothing happens. I have checked the references and the Microsoft Internet Controls and HTML object boxes are ticked. Here is the code:
Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 09/03/2011 by X'
Dim Shell As Object
Dim IE As Object
Set IE = CreateObject("internetexplorer.application")
Dim oIE As Object
Dim oForm As Object
Dim objShellWins As SHDocVw.ShellWindows
Dim objIE As SHDocVw.InternetExplorer
Dim objDoc As Object
Dim usdURL As String
Dim myUSD As String
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
Set Shell = CreateObject("Shell.Application")
For Each IE In Shell.Windows
If IE.LocationURL = "[URL]http://www.google.co.uk/[/URL]" Then
IE.Visible = True
Do While IE.Busy: DoEvents: Loop
Do While IE.ReadyState <> 4: DoEvents: Loop
End If
Next
'
End Sub
If I use an older PC here it works fine on Windows/Excel 2000 but for some reason it no longer runs. Does anyone have any ideas how to rectify this?
Thanks