EDUCATED MONKEY
Board Regular
- Joined
- Jul 17, 2011
- Messages
- 218
Sorry that I have opened another thread I could not find how to append the original one, maybe some one could tell me how to append the original for next time also is the a way to say that you have received an answer that works and you no longer need help with that item?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
<o></o>
XP Professional office XP 2003 IE 8 <o></o>
<o></o>
<o></o>
Further to my request made earlier, “controlling IE using vba from within a worksheet”<o></o>
<o></o>
having done some more research I have managed to cover the first part of opening the Internet Explorer from the sheet, <o></o>
can some one tell me how I go about selecting ALL and Copy the open page and closing the page after use?, during the experiment I found that I had opened most of the pages relating to the urls in the list as it proceeded down the list, I had thought as I open a new page the old one closed but not so, therefore the action required is open get content and close move down the list load next page <o></o>
<o></o>
So the parts I need help or pointers on are these<o></o>
<o></o>
1 Selecting the open page, by mimicking the control A action from the keyboard <o></o>
<o></o>
2 Once the open page has been selected I need to mimicking the control C action from the keyboard <o></o>
<o></o>
3 Once the contents of the selected page have been dropped into column A the IE window needs to be closed, mimicking click the close cross top right of open page <o></o>
<o></o>
XP Professional office XP 2003 IE 8 <o></o>
<o></o>
<o></o>
Further to my request made earlier, “controlling IE using vba from within a worksheet”<o></o>
<o></o>
having done some more research I have managed to cover the first part of opening the Internet Explorer from the sheet, <o></o>
can some one tell me how I go about selecting ALL and Copy the open page and closing the page after use?, during the experiment I found that I had opened most of the pages relating to the urls in the list as it proceeded down the list, I had thought as I open a new page the old one closed but not so, therefore the action required is open get content and close move down the list load next page <o></o>
<o></o>
So the parts I need help or pointers on are these<o></o>
<o></o>
1 Selecting the open page, by mimicking the control A action from the keyboard <o></o>
<o></o>
2 Once the open page has been selected I need to mimicking the control C action from the keyboard <o></o>
<o></o>
3 Once the contents of the selected page have been dropped into column A the IE window needs to be closed, mimicking click the close cross top right of open page <o></o>
Code:
Sub genurl()
'
' genurl Macro
' Macro recorded 06/08/2011 by Peter Hayward
'
' Keyboard Shortcut: Ctrl+f
'
Dim n As Integer
Dim m As Long
Dim q As Integer
Dim aurl As String
Dim EXP
Sheets("AURL").Select
q = Worksheets("AURL").Range("D1").Value ' get how many urls their are left
n = 94 'total number of urls on sheet
m = n - q + 1 ' prepair to move down the column
Worksheets("AURL").Cells(m, 1).Activate
aurl = ActiveCell.Value
q = q - 1 ' move down the list
Worksheets("AURL").Range("D1").Value = q ' store position in list
Set EXP = CreateObject("InternetExplorer.application")
EXP.Visible = True
aurl = Worksheets("AURL").Range("I1").Value ' get the current url
EXP.Navigate (aurl) 'cell I1 is where the url is construction by
' CONCATENATE the body of the url and the vairable part from the list
End Sub
Last edited: