Expand HostIP tool to also resolve for IPv6 addresses

Ted Penner
Ted Penner used Ask the Experts™
on
I had this question after viewing IP Host Resolver - Make compatable with 64bit office.

I would like to expand this tool to also resolve for IPv6 addresses in the subsequent 3rd column if they exist.
160311-Host-IP.xlsm
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
It looks like you are using the code from this page: http://www.codeproject.com/Articles/712335/Followup-DNS-Lookup-and-Ping-in-Excel?ref=binfind.com/web  The comments show an IPv4 DNS lookup.  To get IPv6 info you will need an IPv6 connection with IPv6 DNS.
Ted PennerSoftware Engineer

Author

Commented:
Are you saying that it's not possible to do this without writing proprietary information into the code?
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
The code that you are using has nothing in it to get IPv6 information.  Do you have an IPv6 connection to your machine?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Ted PennerSoftware Engineer

Author

Commented:
If I do ipconfig, it does the trick and gives me the IPv6 address.  I want to have column three output that data.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Then you will have to add code that does the IPv6 lookup.  It's not there and I can't tell you what it is.  You can click on "Request Attention" above and get others to look at your question.  I did not see any similar code for IPv6 when I was searching.

Note: 'ipconfig' just asks your local machine what it's IPv6 address is.  It is not doing a DNS lookup like your code does for IPv4.
Professor JMicrosoft Excel Expert
Top Expert 2014

Commented:
frugalmule

i am not sure if i understood your requirement, but can you give the attached a try and see how it works.
NSlookup-Resolve-HostName-or-IP.xlsm
Ted PennerSoftware Engineer

Author

Commented:
I looked at this from work today and when I pulled it up in Excel 2010, I didn't even have to do anything for column b to change to #VALUE!.
Ted PennerSoftware Engineer

Author

Commented:
I'm starting to really need this solution.  Please resolve if possible.
Professor JMicrosoft Excel Expert
Top Expert 2014

Commented:
Can you please explain how did you get the error?
Did you open the attachment in my latest post?
Ted PennerSoftware Engineer

Author

Commented:
I didn't do anything to get it to happen. I just opened it and watched the data change to #VALUE!
Professor JMicrosoft Excel Expert
Top Expert 2014

Commented:
Did you open it with excel 32 or 64?
Ted PennerSoftware Engineer

Author

Commented:
2010 32 bit
Ted PennerSoftware Engineer

Author

Commented:
OK, I'm seeing good results but in column B, and prior to clicking on "Enable Content".  I still want to hang on to the IPv4 result but also include the IPv6 results, but only if it exists, in a third column.

I'm using Excel 2010 32 bit.  

What I am seeing is that column B returns the IPv6 values, but everything, including hostnames in column B is changed to #VALUE! when the usual "enable content" is pressed.
Professor JMicrosoft Excel Expert
Top Expert 2014
Commented:
@frugalmule

please see attached. i have now put the old codes of Ip4 in column B and IPV6 if applicate in Column C.
160311-Host-IP.xlsm
Ted PennerSoftware Engineer

Author

Commented:
Thank you sir.  However, when I put in my hostname or ip into 7a, it only produces the column B, but leaves column C empty.

Neither case produces an IPv6 address.
Microsoft Excel Expert
Top Expert 2014
Commented:
can you try with the attached?
160311-Host-IP.xlsm
Ted PennerSoftware Engineer

Author

Commented:
Just tried the attached in post ID 41531555 for both IPv4 and Hostname and still nothing for column C.

I tried this on row 7.
Professor JMicrosoft Excel Expert
Top Expert 2014

Commented:
but if you work with attachment uploaded in here  will it work for your Row7?
Ted PennerSoftware Engineer

Author

Commented:
Huh?

That link points me back to this same thread.  What post ID should I try?
Professor JMicrosoft Excel Expert
Top Expert 2014

Commented:
i mean this attachment
NSlookup-Resolve-HostName-or-IP.xlsm
Ted PennerSoftware Engineer

Author

Commented:
The one in post ID 41513236 produces #VALUE! after accepting the two security prompts
Professor JMicrosoft Excel Expert
Top Expert 2014

Commented:
perhaps you have some add-ins or some sort of duplicate sub routine or API declarations that is causing this. i cannot tell what is causing that. in my machine it works perfectly fine.
Ted PennerSoftware Engineer

Author

Commented:
That attachment produces IPv6 for rows 1-4, but goes to #VALUE! after accepting the two security prompts.

The one in post ID 41513236 produces #VALUE! after accepting the two security prompts


The others you posted also produce IPv6 for your entries, but not for new entries on subsequent rows.
Ted PennerSoftware Engineer

Author

Commented:
The one in post ID 41531555 produces IPv6 addresses that disappear after the second security message is accepted.
Professor JMicrosoft Excel Expert
Top Expert 2014

Commented:
can you please post the screenshot of the security message?
Ted PennerSoftware Engineer

Author

Commented:
Sure.  Attached is the error.Errors when opening macro enabled spreadsheets for the first time.
Ted PennerSoftware Engineer

Author

Commented:
Works but buggy, still errors, reposting.


Here is the new question https://www.experts-exchange.com/questions/28937773/HostIP.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial