Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel IP lookup

I have some code below and I can't figure out why it is broken. I am
starting at cell b3 (B is the column that has the IP addresses),
adding that to the end of a URL and retrieving the XML and outputting
it in column N. I keep getting the following error (insert whatever IP
you want):

71.129.48.10 IP NOT FOUND IN DATABASE, SORRY!

What am I doing wrong?



Sub DownloadXML()
'
' DownloadXML Macro
'

Dim xmp As XmlMap
' Select cell B3, *first line of data*.
Range("b3").Select

' Set Do loop to stop when an empty cell is reached.
Do Until IsEmpty(ActiveCell)
For Each xmp In ActiveWorkbook.XmlMaps
xmp.Delete
Next xmp
'Import Data to column M (13 = 10 + 3)
ActiveWorkbook.XmlImport URL:= _
"http://ipinfodb.com/ip_query.php?ip=" & ActiveCell.Value,
ImportMap:=Nothing, _
Overwrite:=True, Destination:=ActiveCell.Offset(0,
11).Address

' Step down 1 row from present location.
ActiveCell.Offset(1, -11).Select
Loop
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 747
Default Excel IP lookup

its running fine for me.

I am getting this results
71.129.48.10 OK US United States 6 California Los Angeles
34.0416 -118.299 -8 -8 -7


On Oct 26, 10:31*pm, "pand0ra.usa" wrote:
I have some code below and I can't figure out why it is broken. I am
starting at cell b3 (B is the column that has the IP addresses),
adding that to the end of a URL and retrieving the XML *and outputting
it in column N. I keep getting the following error (insert whatever IP
you want):

71.129.48.10 * *IP NOT FOUND IN DATABASE, SORRY!

What am I doing wrong?

Sub DownloadXML()
'
' DownloadXML Macro
'

Dim xmp As XmlMap
* * * ' Select cell B3, *first line of data*.
* * * Range("b3").Select

* * * ' Set Do loop to stop when an empty cell is reached.
* * * Do Until IsEmpty(ActiveCell)
* * * * * * For Each xmp In ActiveWorkbook.XmlMaps
* * * * * * * * xmp.Delete
* * * * * * Next xmp
* * * * *'Import Data to column M (13 = 10 + 3)
* * * * *ActiveWorkbook.XmlImport URL:= _
* * * * * * "http://ipinfodb.com/ip_query.php?ip=" & ActiveCell.Value,
ImportMap:=Nothing, _
* * * * * * Overwrite:=True, Destination:=ActiveCell.Offset(0,
11).Address

* * * * *' Step down 1 row from present location.
* * * * *ActiveCell.Offset(1, -11).Select
* * * Loop
* *End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel IP lookup

It must be something wrong with the import I am doing before I am
running the script that is causing the problem.


On Oct 26, 12:06*pm, muddan madhu wrote:
its running fine for me.

I am getting this results
71.129.48.10 * *OK * * *US * * *United States * 6 * * * California * * *Los Angeles
34.0416 -118.299 * * * *-8 * * *-8 * * *-7

On Oct 26, 10:31*pm, "pand0ra.usa" wrote:

I have some code below and I can't figure out why it is broken. I am
starting at cell b3 (B is the column that has the IP addresses),
adding that to the end of a URL and retrieving the XML *and outputting
it in column N. I keep getting the following error (insert whatever IP
you want):


71.129.48.10 * *IP NOT FOUND IN DATABASE, SORRY!


What am I doing wrong?


Sub DownloadXML()
'
' DownloadXML Macro
'


Dim xmp As XmlMap
* * * ' Select cell B3, *first line of data*.
* * * Range("b3").Select


* * * ' Set Do loop to stop when an empty cell is reached.
* * * Do Until IsEmpty(ActiveCell)
* * * * * * For Each xmp In ActiveWorkbook.XmlMaps
* * * * * * * * xmp.Delete
* * * * * * Next xmp
* * * * *'Import Data to column M (13 = 10 + 3)
* * * * *ActiveWorkbook.XmlImport URL:= _
* * * * * * "http://ipinfodb.com/ip_query.php?ip=" & ActiveCell.Value,
ImportMap:=Nothing, _
* * * * * * Overwrite:=True, Destination:=ActiveCell.Offset(0,
11).Address


* * * * *' Step down 1 row from present location.
* * * * *ActiveCell.Offset(1, -11).Select
* * * Loop
* *End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Get Cell Address From Lookup (Alternative to Lookup) ryguy7272 Excel Worksheet Functions 12 September 28th 07 10:36 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM
Sumproduct - Condition based on lookup of a Lookup Hari Excel Discussion (Misc queries) 12 May 31st 06 09:28 AM


All times are GMT +1. The time now is 05:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"