<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Geocoding in Excel using Google Maps API</title>
	<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/</link>
	<description></description>
	<pubDate>Sun, 12 Oct 2008 10:57:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.1</generator>

	<item>
		<title>by: JS</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-38062</link>
		<pubDate>Fri, 15 Feb 2008 16:00:28 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-38062</guid>
					<description>Steve
Change router to a function by changing code like this:

Sub Router()   &lt;em&gt;- change to Router(sStart as string, sEnd as string) as string&lt;/em&gt;
‘function(sStart As String, sEnd As String) as string  &lt;em&gt;-delete this line&lt;/em&gt;
‘//Dont want to open and close all day long - make once use many
Dim sLocation As String
Dim sStart As String   &lt;em&gt; - delete this line&lt;/em&gt;
Dim sEnd As String     &lt;em&gt;- delete this line&lt;/em&gt;
Dim Answer As String

sStart = “Warsawa+Poland”   &lt;em&gt; -delete this line&lt;/em&gt;
sEnd = “Northampton+England”   &lt;em&gt;-delete this line&lt;/em&gt;...
&lt;em&gt;find this line...&lt;/em&gt;
MsgBox sStart &amp;#38; ” to ” &amp;#38; sEnd &amp;#38; vbCrLf _
&amp;#38; ansMiles &amp;#38; ” ” &amp;#38; ansUom &amp;#38; ” : ” &amp;#38; ansHrs + (ansMin * (100 / 60) * 0.01) &amp;#38; ” Hrs”
&lt;em&gt;replace with&lt;/em&gt;
Router= sStart &amp;#38; ” to ” &amp;#38; sEnd &amp;#38; vbCrLf _
&amp;#38; ansMiles &amp;#38; ” ” &amp;#38; ansUom &amp;#38; ” : ” &amp;#38; ansHrs + (ansMin * (100 / 60) * 0.01) &amp;#38; ” Hrs”

&lt;em&gt;so the function entry is &lt;strong&gt;=router(YourStartLocation, YourEndLocation) &lt;/strong&gt;and the result is a string in the cell listing the distance etc.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>Steve<br />
Change router to a function by changing code like this:</p>
<p>Sub Router()   <em>- change to Router(sStart as string, sEnd as string) as string</em><br />
‘function(sStart As String, sEnd As String) as string  <em>-delete this line</em><br />
‘//Dont want to open and close all day long - make once use many<br />
Dim sLocation As String<br />
Dim sStart As String   <em> - delete this line</em><br />
Dim sEnd As String     <em>- delete this line</em><br />
Dim Answer As String</p>
<p>sStart = “Warsawa+Poland”   <em> -delete this line</em><br />
sEnd = “Northampton+England”   <em>-delete this line</em>&#8230;<br />
<em>find this line&#8230;</em><br />
MsgBox sStart &amp; ” to ” &amp; sEnd &amp; vbCrLf _<br />
&amp; ansMiles &amp; ” ” &amp; ansUom &amp; ” : ” &amp; ansHrs + (ansMin * (100 / 60) * 0.01) &amp; ” Hrs”<br />
<em>replace with</em><br />
Router= sStart &amp; ” to ” &amp; sEnd &amp; vbCrLf _<br />
&amp; ansMiles &amp; ” ” &amp; ansUom &amp; ” : ” &amp; ansHrs + (ansMin * (100 / 60) * 0.01) &amp; ” Hrs”</p>
<p><em>so the function entry is <strong>=router(YourStartLocation, YourEndLocation) </strong>and the result is a string in the cell listing the distance etc.</em>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: steve</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-37322</link>
		<pubDate>Mon, 11 Feb 2008 13:26:46 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-37322</guid>
					<description>Hello everybody,

I put it in as a new function named 'router' in the original sheet.
Wat is the statement I have to put in a cell of my excel sheet to get the result.
ex. for goecode it is =geocode(C51&amp;#38;&quot; &quot;&amp;#38;D51&amp;#38;&quot; &quot;&amp;#38;E51&amp;#38;&quot; &quot;&amp;#38;F51)

thanks,

Steve</description>
		<content:encoded><![CDATA[<p>Hello everybody,</p>
<p>I put it in as a new function named &#8216;router&#8217; in the original sheet.<br />
Wat is the statement I have to put in a cell of my excel sheet to get the result.<br />
ex. for goecode it is =geocode(C51&amp;&#8221; &#8220;&amp;D51&amp;&#8221; &#8220;&amp;E51&amp;&#8221; &#8220;&amp;F51)</p>
<p>thanks,</p>
<p>Steve
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: JS</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34345</link>
		<pubDate>Fri, 11 Jan 2008 23:22:43 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34345</guid>
					<description>Oh!  I guess this may be a difference in the output from Google for different geographies.  Suggest you might put a &quot;debug.print answer&quot; after line with &quot;Answer = Mid(Answer, InStr(Answer, “class=pw&amp;#62;”) + 9, 50)&quot;. The string SHOULD (it does for me) contain data that aligns with (a) a mileage (b) a journey location.  (that is the target answer, but to report it properly you will need to play with the subsequent text slicing formulas to get each element out properly.  My guess is that the change in what you are finding is due to different formats between Europe output and North America.
Otherwise examine the previous (raw) output from Google.
I think there must be a more elegant solution than mine, I am hoping Ross comes up with that!</description>
		<content:encoded><![CDATA[<p>Oh!  I guess this may be a difference in the output from Google for different geographies.  Suggest you might put a &#8220;debug.print answer&#8221; after line with &#8220;Answer = Mid(Answer, InStr(Answer, “class=pw&gt;”) + 9, 50)&#8221;. The string SHOULD (it does for me) contain data that aligns with (a) a mileage (b) a journey location.  (that is the target answer, but to report it properly you will need to play with the subsequent text slicing formulas to get each element out properly.  My guess is that the change in what you are finding is due to different formats between Europe output and North America.<br />
Otherwise examine the previous (raw) output from Google.<br />
I think there must be a more elegant solution than mine, I am hoping Ross comes up with that!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Larry W.</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34260</link>
		<pubDate>Thu, 10 Jan 2008 20:47:52 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34260</guid>
					<description>JS - thanks again for the help to this newbie. I think I must have copied something wrong (thought I've done it a few times.) Any way to get this in a text file.

When I tried your suggestion this is what I get in the Immediate Window for the debug Answer.

d=homestate&amp;#62;</description>
		<content:encoded><![CDATA[<p>JS - thanks again for the help to this newbie. I think I must have copied something wrong (thought I&#8217;ve done it a few times.) Any way to get this in a text file.</p>
<p>When I tried your suggestion this is what I get in the Immediate Window for the debug Answer.</p>
<p>d=homestate&gt;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: JS</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34246</link>
		<pubDate>Thu, 10 Jan 2008 18:42:28 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34246</guid>
					<description>OK thats should be straightforward to fix.  the Answer variable is just a string extracted from the google return data. The code assumes in there is a &quot;&amp;#38;&quot; and then extracts a sub-string which should be some numbers showing miles (I said it was crude!). If you put a debug.print answer in the previous line and put a break on this you can stop and check what the answer string is you are working on, maybe you can then tune the formula.  My guess is that the CSng (conversion of the text to a number) is the cause of failure; the string extracted has, say, space in it.  Hope that helps</description>
		<content:encoded><![CDATA[<p>OK thats should be straightforward to fix.  the Answer variable is just a string extracted from the google return data. The code assumes in there is a &#8220;&amp;&#8221; and then extracts a sub-string which should be some numbers showing miles (I said it was crude!). If you put a debug.print answer in the previous line and put a break on this you can stop and check what the answer string is you are working on, maybe you can then tune the formula.  My guess is that the CSng (conversion of the text to a number) is the cause of failure; the string extracted has, say, space in it.  Hope that helps
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Larry W.</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34224</link>
		<pubDate>Thu, 10 Jan 2008 13:35:45 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34224</guid>
					<description>Yes I did and yes his Geocode sheet works great. 

I also added this as a new procedure (and tried it as a seperate worksheet) and it fails at ansMiles = CSng(Left(Answer, InStr(Answer, &quot;&amp;#38;&quot;) - 1))  that line every time. I am not sure why - I'm newer to coding.

Thanks for the reply - larry.weideman (at) gmail.com</description>
		<content:encoded><![CDATA[<p>Yes I did and yes his Geocode sheet works great. </p>
<p>I also added this as a new procedure (and tried it as a seperate worksheet) and it fails at ansMiles = CSng(Left(Answer, InStr(Answer, &#8220;&amp;&#8221;) - 1))  that line every time. I am not sure why - I&#8217;m newer to coding.</p>
<p>Thanks for the reply - larry.weideman (at) gmail.com
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: JS</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34220</link>
		<pubDate>Thu, 10 Jan 2008 12:00:40 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34220</guid>
					<description>Larry
Have you followed all of Ross's original instructions about getting a Google API key?
I have used Ross's worksheet and added Router as a new procedure. If you are getting a good result on his original geo-coding procedure, I cannot see why it would not calc.
Maybe comment out the 'On Error GoTo depart' line and see where the error is coming up?
JS</description>
		<content:encoded><![CDATA[<p>Larry<br />
Have you followed all of Ross&#8217;s original instructions about getting a Google API key?<br />
I have used Ross&#8217;s worksheet and added Router as a new procedure. If you are getting a good result on his original geo-coding procedure, I cannot see why it would not calc.<br />
Maybe comment out the &#8216;On Error GoTo depart&#8217; line and see where the error is coming up?<br />
JS
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Larry W.</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34126</link>
		<pubDate>Wed, 09 Jan 2008 14:37:12 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-34126</guid>
					<description>JS - thanks for the reply. I keep getting Journey Did Not Calculate though. Any ideas? 

Larry.Weideman (at) gmail.com</description>
		<content:encoded><![CDATA[<p>JS - thanks for the reply. I keep getting Journey Did Not Calculate though. Any ideas? </p>
<p>Larry.Weideman (at) gmail.com
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: JS</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-33822</link>
		<pubDate>Mon, 07 Jan 2008 14:39:01 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-33822</guid>
					<description>How strange, Less than symbol in listing kills the rest of the listing...

If Len(Answer) [less than] then
        Debug.Print &quot;no journey result&quot;
    Else
        Debug.Print Answer
        ansMiles = CSng(Left(Answer, InStr(Answer, &quot;&amp;#38;&quot;) - 1))
        ansUom = Mid(Answer, InStr(1, Answer, &quot;;&quot;) + 1, 2)
        ansHrs = CInt(Mid(Answer, InStr(1, Answer, &quot;about &quot;) + 6, 2))
        ansMin = CInt(Mid(Answer, InStr(1, Answer, &quot;hours &quot;) + 6, 2))
        MsgBox sStart &amp;#38; &quot; to &quot; &amp;#38; sEnd &amp;#38; vbCrLf _
            &amp;#38; ansMiles &amp;#38; &quot; &quot; &amp;#38; ansUom &amp;#38; &quot; : &quot; &amp;#38; ansHrs + (ansMin * (100 / 60) * 0.01) &amp;#38; &quot; Hrs&quot;
                
    End If
    
   
Exit Sub
depart:
    MsgBox &quot;Journey did not calculate&quot;
    'Answer = CStr(CloseIEApp)

End Sub</description>
		<content:encoded><![CDATA[<p>How strange, Less than symbol in listing kills the rest of the listing&#8230;</p>
<p>If Len(Answer) [less than] then<br />
        Debug.Print &#8220;no journey result&#8221;<br />
    Else<br />
        Debug.Print Answer<br />
        ansMiles = CSng(Left(Answer, InStr(Answer, &#8220;&amp;&#8221;) - 1))<br />
        ansUom = Mid(Answer, InStr(1, Answer, &#8220;;&#8221;) + 1, 2)<br />
        ansHrs = CInt(Mid(Answer, InStr(1, Answer, &#8220;about &#8220;) + 6, 2))<br />
        ansMin = CInt(Mid(Answer, InStr(1, Answer, &#8220;hours &#8220;) + 6, 2))<br />
        MsgBox sStart &amp; &#8221; to &#8221; &amp; sEnd &amp; vbCrLf _<br />
            &amp; ansMiles &amp; &#8221; &#8221; &amp; ansUom &amp; &#8221; : &#8221; &amp; ansHrs + (ansMin * (100 / 60) * 0.01) &amp; &#8221; Hrs&#8221;</p>
<p>    End If</p>
<p>Exit Sub<br />
depart:<br />
    MsgBox &#8220;Journey did not calculate&#8221;<br />
    &#8216;Answer = CStr(CloseIEApp)</p>
<p>End Sub
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: JS</title>
		<link>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-33821</link>
		<pubDate>Mon, 07 Jan 2008 14:37:05 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2007/11/12/geocoding-in-excel-using-google-maps-api/#comment-33821</guid>
					<description>sorry missed the key bit from listing....

    Answer = appIE.Document.Body.innerHTML
    Answer = Mid(Answer, InStr(Answer, &quot;class=pw&amp;#62;&quot;) + 9, 50)
    If Len(Answer) </description>
		<content:encoded><![CDATA[<p>sorry missed the key bit from listing&#8230;.</p>
<p>    Answer = appIE.Document.Body.innerHTML<br />
    Answer = Mid(Answer, InStr(Answer, &#8220;class=pw&gt;&#8221;) + 9, 50)<br />
    If Len(Answer)
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
