ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   2003 Macro not working in 2007 (https://www.excelbanter.com/excel-programming/437817-2003-macro-not-working-2007-a.html)

kintaro

2003 Macro not working in 2007
 
Can someone please help. I have macro for IE automation in 2003 but I do not
know VBA. Here is the code that works in 2003 but will not run in 2007. Does
anyone know what the new code would be for Excel 2007.

This is the VBA code
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Navigate "http://mywebsite.com"
Do While .Busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
.Visible = True

This is where Excel 2007 gets stuck.
Do While .ReadyState < 4: DoEvents: Loop

Then it gets stuck here.
..Document.getElementById("Description").Value = ActiveCell.Value

Any help with translating this from 2003 to 2007 would be greatly appreciated.






Barb Reinhardt

2003 Macro not working in 2007
 
I suspect you're missing a reference to Microsoft Internet Controls. Look
under Tools - References in the VBE and verity.
--
HTH,

Barb Reinhardt



"kintaro" wrote:

Can someone please help. I have macro for IE automation in 2003 but I do not
know VBA. Here is the code that works in 2003 but will not run in 2007. Does
anyone know what the new code would be for Excel 2007.

This is the VBA code
Dim objIE As Object
Set objIE = CreateObject("InternetExplorer.Application")
With objIE
.Navigate "http://mywebsite.com"
Do While .Busy: DoEvents: Loop
Do While .ReadyState < 4: DoEvents: Loop
.Visible = True

This is where Excel 2007 gets stuck.
Do While .ReadyState < 4: DoEvents: Loop

Then it gets stuck here.
.Document.getElementById("Description").Value = ActiveCell.Value

Any help with translating this from 2003 to 2007 would be greatly appreciated.







All times are GMT +1. The time now is 09:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com