Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm looking for code to grab data from a browser window that is currently open. The browser title will be fixed. I don't prefer the web query option as the data in question is accessible only after logging in and other clicks. I use Office XP and Windows XP SP2. Thanks, Vivek |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Google this group for "IE automation"
Tim "Vivek" wrote in message ... Hi, I'm looking for code to grab data from a browser window that is currently open. The browser title will be fixed. I don't prefer the web query option as the data in question is accessible only after logging in and other clicks. I use Office XP and Windows XP SP2. Thanks, Vivek |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tim,
Tried your tip but could not find any usable posts. Can you point to any specific post in your knowledge that deals with code for trying to grab data from IE. That would be very useful for me. This is only for one-time personal use :) Thanks, Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Google this group for "IE automation" Tim "Vivek" wrote in message ... Hi, I'm looking for code to grab data from a browser window that is currently open. The browser title will be fixed. I don't prefer the web query option as the data in question is accessible only after logging in and other clicks. I use Office XP and Windows XP SP2. Thanks, Vivek |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Without knowing exactly what info you need to extract from the page it's
difficult to offer anything concrete, but something like this would get you started: Sub Tester() dim oDoc set oDoc = GetIE(http://www.somesite.com/) if not oDoc is nothing then 'do something with oDoc msgbox oDoc.body.innerHTML else msgbox "not found" end if End Sub 'Find an open IE window with matching location and ' return a reference to the document object Function GetIE(sAddress As String) As Object Dim objShell As Object, objShellWindows As Object, o As Object Dim retVal As Object, sURL As String Set retVal = Nothing Set objShell = CreateObject("Shell.Application") Set objShellWindows = objShell.Windows For Each o In objShellWindows sURL = "" On Error Resume Next sURL = o.document.Location On Error GoTo 0 If sURL < "" Then If sURL Like sAddress & "*" Then Set retVal = o.document Exit For End If End If Next o Set GetIE = retVal End Function Tim "Vivek" wrote in message ... Tim, Tried your tip but could not find any usable posts. Can you point to any specific post in your knowledge that deals with code for trying to grab data from IE. That would be very useful for me. This is only for one-time personal use :) Thanks, Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Google this group for "IE automation" Tim "Vivek" wrote in message ... Hi, I'm looking for code to grab data from a browser window that is currently open. The browser title will be fixed. I don't prefer the web query option as the data in question is accessible only after logging in and other clicks. I use Office XP and Windows XP SP2. Thanks, Vivek |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tim.
When i put your code in a module the "set oDoc=" line appears in red. Running the macro results in a syntax error on that line. What could be going wrong here and how can I fix it? I'm looking to extract a table from the website - similar to what a web query does from within Excel. Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Without knowing exactly what info you need to extract from the page it's difficult to offer anything concrete, but something like this would get you started: Sub Tester() dim oDoc set oDoc = GetIE(http://www.somesite.com/) if not oDoc is nothing then 'do something with oDoc msgbox oDoc.body.innerHTML else msgbox "not found" end if End Sub 'Find an open IE window with matching location and ' return a reference to the document object Function GetIE(sAddress As String) As Object Dim objShell As Object, objShellWindows As Object, o As Object Dim retVal As Object, sURL As String Set retVal = Nothing Set objShell = CreateObject("Shell.Application") Set objShellWindows = objShell.Windows For Each o In objShellWindows sURL = "" On Error Resume Next sURL = o.document.Location On Error GoTo 0 If sURL < "" Then If sURL Like sAddress & "*" Then Set retVal = o.document Exit For End If End If Next o Set GetIE = retVal End Function Tim "Vivek" wrote in message ... Tim, Tried your tip but could not find any usable posts. Can you point to any specific post in your knowledge that deals with code for trying to grab data from IE. That would be very useful for me. This is only for one-time personal use :) Thanks, Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Google this group for "IE automation" Tim "Vivek" wrote in message ... Hi, I'm looking for code to grab data from a browser window that is currently open. The browser title will be fixed. I don't prefer the web query option as the data in question is accessible only after logging in and other clicks. I use Office XP and Windows XP SP2. Thanks, Vivek |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Post the code exactly as you have entered it in Excel.
Tim "Vivek" wrote in message ... Thanks Tim. When i put your code in a module the "set oDoc=" line appears in red. Running the macro results in a syntax error on that line. What could be going wrong here and how can I fix it? I'm looking to extract a table from the website - similar to what a web query does from within Excel. Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Without knowing exactly what info you need to extract from the page it's difficult to offer anything concrete, but something like this would get you started: Sub Tester() dim oDoc set oDoc = GetIE(http://www.somesite.com/) if not oDoc is nothing then 'do something with oDoc msgbox oDoc.body.innerHTML else msgbox "not found" end if End Sub 'Find an open IE window with matching location and ' return a reference to the document object Function GetIE(sAddress As String) As Object Dim objShell As Object, objShellWindows As Object, o As Object Dim retVal As Object, sURL As String Set retVal = Nothing Set objShell = CreateObject("Shell.Application") Set objShellWindows = objShell.Windows For Each o In objShellWindows sURL = "" On Error Resume Next sURL = o.document.Location On Error GoTo 0 If sURL < "" Then If sURL Like sAddress & "*" Then Set retVal = o.document Exit For End If End If Next o Set GetIE = retVal End Function Tim "Vivek" wrote in message ... Tim, Tried your tip but could not find any usable posts. Can you point to any specific post in your knowledge that deals with code for trying to grab data from IE. That would be very useful for me. This is only for one-time personal use :) Thanks, Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Google this group for "IE automation" Tim "Vivek" wrote in message ... Hi, I'm looking for code to grab data from a browser window that is currently open. The browser title will be fixed. I don't prefer the web query option as the data in question is accessible only after logging in and other clicks. I use Office XP and Windows XP SP2. Thanks, Vivek |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try putting the argument in quotes and see if that helps...
set oDoc = GetIE("http://www.somesite.com/") Rick "Vivek" wrote in message ... Thanks Tim. When i put your code in a module the "set oDoc=" line appears in red. Running the macro results in a syntax error on that line. What could be going wrong here and how can I fix it? I'm looking to extract a table from the website - similar to what a web query does from within Excel. Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Without knowing exactly what info you need to extract from the page it's difficult to offer anything concrete, but something like this would get you started: Sub Tester() dim oDoc set oDoc = GetIE(http://www.somesite.com/) if not oDoc is nothing then 'do something with oDoc msgbox oDoc.body.innerHTML else msgbox "not found" end if End Sub 'Find an open IE window with matching location and ' return a reference to the document object Function GetIE(sAddress As String) As Object Dim objShell As Object, objShellWindows As Object, o As Object Dim retVal As Object, sURL As String Set retVal = Nothing Set objShell = CreateObject("Shell.Application") Set objShellWindows = objShell.Windows For Each o In objShellWindows sURL = "" On Error Resume Next sURL = o.document.Location On Error GoTo 0 If sURL < "" Then If sURL Like sAddress & "*" Then Set retVal = o.document Exit For End If End If Next o Set GetIE = retVal End Function Tim "Vivek" wrote in message ... Tim, Tried your tip but could not find any usable posts. Can you point to any specific post in your knowledge that deals with code for trying to grab data from IE. That would be very useful for me. This is only for one-time personal use :) Thanks, Vivek "Tim Williams" <timjwilliams at gmail dot com wrote in message ... Google this group for "IE automation" Tim "Vivek" wrote in message ... Hi, I'm looking for code to grab data from a browser window that is currently open. The browser title will be fixed. I don't prefer the web query option as the data in question is accessible only after logging in and other clicks. I use Office XP and Windows XP SP2. Thanks, Vivek |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to get Excel to grab data from browser? | Excel Programming | |||
Passing Data to Internet Browser | Excel Programming | |||
Moving Data from a Web Browser to Excel | Excel Discussion (Misc queries) | |||
need help sorting data in browser | Excel Programming | |||
display in memory data in browser window | Excel Programming |