Dear All:
<o> </o>
I’m using the following code for extracting contents from my company webpage. The web content is originally created in MS excel and saved as html file and upload to the company site.
<o> </o>
Recently I found out that, the webpage page content is not getting copied to the excel file and throwing an error always (Run-time error: 1004 Method "Paste" of object "_Worksheet" failed.). Later I understood that, the selection of webpage content is not happening and that causes the error
<o> </o>
I also learned that, previously once the webpage is loaded, I could directly use Ctrl+A to select the entire content and now it require to click somewhere in the webpage before I use Ctrl+A
<o> </o>
Im using Excel ver: 97-2003 and OS: Win XP
<o> </o>
I need your help to solve the following issues
<o> </o>
(Run-time Error -2147417848 (80010108) Automation error the object invoked has disconnected from its clients). And “Do Until IE.ReadyState = 4” is being highlighted while debug
<o> </o>
I believe company webpage can’t be opened outside the company network
Thanks in advance
<o> </o>
I’m using the following code for extracting contents from my company webpage. The web content is originally created in MS excel and saved as html file and upload to the company site.
<o> </o>
Recently I found out that, the webpage page content is not getting copied to the excel file and throwing an error always (Run-time error: 1004 Method "Paste" of object "_Worksheet" failed.). Later I understood that, the selection of webpage content is not happening and that causes the error
<o> </o>
I also learned that, previously once the webpage is loaded, I could directly use Ctrl+A to select the entire content and now it require to click somewhere in the webpage before I use Ctrl+A
<o> </o>
Im using Excel ver: 97-2003 and OS: Win XP
<o> </o>
I need your help to solve the following issues
<o> </o>
- How to automate the clicking in the webpage (or a different solution) so that the selection and copying will run smoothly
- This code is not working in excel 2007 and how to make it compatible for excel 2007. I’m getting following error while running the code in Excel 2007
(Run-time Error -2147417848 (80010108) Automation error the object invoked has disconnected from its clients). And “Do Until IE.ReadyState = 4” is being highlighted while debug
<o> </o>
I believe company webpage can’t be opened outside the company network
Rich (BB code):
Rich (BB code):
Rich (BB code):
Rich (BB code):
Sub extract ()<o:p></o:p>
<o:p> </o:p>
Application.DisplayAlerts = False<o:p></o:p>
<o:p> </o:p>
Dim IE As Object<o:p></o:p>
Set IE = CreateObject("InternetExplorer.Application")<o:p></o:p>
<o:p></o:p>
IE.Navigate "http://www.xps.org/new/wiw/english/br.htm" <o:p></o:p>
IE.Visible = False<o:p></o:p>
<o:p> </o:p>
Do Until IE.ReadyState = 4: DoEvents: <st1:place w:st="on">Loop</st1:place> 'READYSTATE_COMPLETE<o:p></o:p>
Do While IE.Busy: DoEvents: <st1:place w:st="on">Loop</st1:place><o:p></o:p>
<o:p> </o:p>
IE.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT<o:p></o:p>
IE.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT<o:p></o:p>
<o:p> </o:p>
Sheet1.Activate
Sheet1.Range("A1:K1000").ClearContents<o:p></o:p>
Sheet1.Range("A1").Select<o:p></o:p>
Sheet1.PasteSpecial Format:="HTML", link:=False, DisplayAsIcon:=False<o:p></o:p>
IE.Quit<o:p></o:p>
<o:p> </o:p>
End Sub
Thanks in advance