Please Use this:

 

Public Function AddCommentMap( _ 
Optional sAddress As String, _ 
Optional sAddress2 As String, _ 
Optional lZoom As Long = 12, _ 
Optional lHeight As Long = 512, _ 
Optional lWidth As Long = 512, _ 
Optional bVisible As Boolean = False, _ 
Optional sText = "") 
'Add or cancel comment 
'if sAddress="" then cancel comment 
Dim rng As Excel.Range 
Dim c As Comment 
Application.Volatile False 
Set rng = Application.Caller 
With rng 
.ClearComments 
If Len(sAddress) Then 
Set c = .AddComment 
c.Visible = bVisible 
c.Shape.Fill.UserPicture _ 
"
<http://www.linkedin.com/redirect?url=http%3A%2F%2Fmaps%2Egoogleapis%2Ecom%2
Fmaps%2Fapi%2Fstaticmap%3Fcenter%3D&urlhash=kLSs&_t=tracking_disc>
http://maps.googleapis.com/maps/api/staticmap?center="; & _ 
Replace(sAddress, " ", "+") & "," & _ 
Replace(sAddress2, " ", "+") & _ 
"&zoom=" & _ 
lZoom & "&size=" & _ 
lWidth & _ 
"x" & _ 
lHeight & _ 
"&maptype=roadmap&markers=color:green%7Clabel:%7C" & _ 
Replace(sAddress, " ", "+") & _ 
"&maptype=roadmap&markers=color:red%7Clabel:%7C" & _ 
Replace(sAddress2, " ", "+") & _ 
"&sensor=false" 
c.Shape.Height = lHeight 
c.Shape.Width = lWidth 
End If 
End With 
AddCommentMap = sText 
End Function


you can try to call from a cell: 
=AddCommentMap("20121 milano","20161 milano",10)

 

 

Also check below links

 

http://excelvbamacros.freeforums.org/get-distance-between-two-cities-from-go
ogle-map-t18.html 

 

http://ramblings.mcpher.com/Home/excelquirks/gooscript 

 

 check below link this discussion is about Google map and excel integration
only 

 

http://www.linkedin.com/groups/Distance-between-Zip-Codes-3843467.S.97120237
?qid=80157264-8a9a-4af5-9c96-53626599ea5c
<http://www.linkedin.com/groups/Distance-between-Zip-Codes-3843467.S.9712023
7?qid=80157264-8a9a-4af5-9c96-53626599ea5c&trk=group_items_see_more-0-b-ttl>
&trk=group_items_see_more-0-b-ttl 

 

 

Regards

Rajan

 

From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com]
On Behalf Of Sara Lee
Sent: Mar/Sat/2012 09:21
To: excel-macros@googlegroups.com
Subject: $$Excel-Macros$$ plot

 

is there any way in excel where we can plot locations on a map and calculate
the distance b/w locations on a map

-- 
FORUM RULES (986+ members already BANNED for violation)
 
1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.
 
2) Don't post a question in the thread of another member.
 
3) Don't post questions regarding breaking or bypassing any security
measure.
 
4) Acknowledge the responses you receive, good or bad.
 
5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited. 
 
NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.
 
----------------------------------------------------------------------------
--------------------------
To post to this group, send email to excel-macros@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to