Sub PlotOnGoogle()
Dim rCell As Range, FileName As String, StoreNum As String
Dim Latitude As String, Longitude As String
Dim StoreName As String, StoreType As String, StoreTrailers As String
FileName = ThisWorkbook.path & "\Icons\Google Maps.html" ' custom icons and temp file
'create the fist part of the file ##############################################################################################################
Open FileName For Output As #1
Print #1, "<!DOCTYPE html>"
Print #1, "<html>"
Print #1, " <head>"
Print #1, " <meta name=" + Chr$(34) + "viewport" + Chr$(34) + " content=" + Chr$(34) + "initial-scale=1.0, user-scalable=no" + Chr$(34) + ">"
Print #1, " <meta charset=" + Chr$(34) + "utf-8" + Chr$(34) + ">"
Print #1, " <title>Google Maps</title>"
Print #1, " <style>"
Print #1, " html, body, #map-canvas"
Print #1, " {"
Print #1, " height: 100%;"
Print #1, " margin: 0px;"
Print #1, " padding: 0px"
Print #1, " }"
Print #1, " </style>"
Print #1, " <script src=" + Chr$(34) + "https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true" + Chr$(34) + "></script>"
Print #1, " <script>"
Print #1, ""
Print #1, "function initialize()"
Print #1, "{"
Print #1, " var mapOptions ="
Print #1, " {"
Print #1, " zoom: 9,"
Print #1, " center: new google.maps.LatLng(51.405180, -0.406724)"
Print #1, " };"
Print #1, ""
Print #1, " var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);"
Print #1, ""
Print #1, " var imageSC = 'file://C:/Users/A/Desktop/Icons/SC.png';"
Print #1, " var imageSM = 'file://C:/Users/A/Desktop/Icons/SM.png';"
Print #1, " var imageBH = 'file://C:/Users/A/Desktop/Icons/BH.png';"
Print #1, " var imageDepot = 'file://C:/Users/A/Desktop/Icons/Depot.png';"
Print #1, " var imagePFS = 'file://C:/Users/A/Desktop/Icons/PFS.png';"
'create the specific pin part of the file ##########################################################################################################
For Each rCell In Sheet1.Range("A2:A" & Sheet1.Range("A" & Rows.Count).End(xlUp).Row).Cells
Latitude = rCell.Offset(, 2).Value
Longitude = rCell.Offset(, 3).Value
StoreNum = rCell.Value
StoreName = rCell.Offset(, 1).Value
StoreType = rCell.Offset(, 4).Value
StoreTrailers = rCell.Offset(, 5).Value
Print #1, ""
Print #1, " var marker" + CStr(rCell.Row) + "= new google.maps.Marker({"
Print #1, " position: new google.maps.LatLng(" + Latitude + ", " + Longitude + "),"
Print #1, " title: " + Chr$(34) + StoreNum + "\n" + StoreName + "\n" + StoreType + "\n" + StoreTrailers + Chr$(34) + ","
Print #1, " map: map,"
'Print #1, " icon:image" & rCell.Offset(, 4).Value & ","
Print #1, " });"
Print #1, ""
Print #1, " google.maps.event.addListener(marker" + CStr(rCell.Row) + ", 'dragend', function(event)"
Print #1, " {"
Print #1, " var Title = marker" + CStr(rCell.Row) + ".getTitle();"
Print #1, " var SubStrings = Title.split(" + Chr$(34) + "\n" + Chr$(34) + ");"
Print #1, " });"
Next rCell
'create the last part of the file ##############################################################################################################
Print #1, "}"
Print #1, ""
Print #1, "google.maps.event.addDomListener(window, 'load', initialize);"
Print #1, ""
Print #1, " </script>"
Print #1, " </head>"
Print #1, " <body>"
Print #1, " <div id=" + Chr$(34) + "map-canvas" + Chr$(34) + "></div>"
Print #1, " </body>"
Print #1, "</html>"
Close #1
ActiveWorkbook.FollowHyperlink Address:=FileName, NewWindow:=False
End Sub
Now everything works fine in regards to it does what i want it to.