Saturday, 2 February 2013

Google map integration

Google Map - Simple Example


<script src="//maps.google.com/maps/api/js?sensor=true"></script>
<script>
function initialize()
{
var mapProp = {
    /** Add lat/lng of your location **/
  center:new google.maps.LatLng(51.508742,-0.120850),
  zoom:5,
  mapTypeId:google.maps.MapTypeId.ROADMAP//try SATELLITE,HYBRID,TERRAIN
  };
var map=new google.maps.Map(document.getElementById("googleMapId1"),mapProp);
}

google.maps.event.addDomListener(window, 'load', initialize);
</script>


<div id="googleMapId1" style="height: 300px; width: 650px;">
</div>


Sensor: The sensor parameter is required & it indicates whether this application uses a sensor (such as a GPS locator) to determine the user's location. Set this value to either true or false.

Zoom: The zoom property specifies the initial zoom level for the map. zoom: 0 shows a map of the Earth fully zoomed out. Higher zoom levels zoom in at a higher resolution.

MapTypeId: The mapTypeId property specifies the initial map type to display.
The following map types are supported:
  1. ROADMAP (normal, default 2D map)
  2. SATELLITE (Photographic map)
  3. HYBRID (Photographic map + roads and City)
  4. TERRAIN

Convert worksheets into csv files

I would like to share a macro with you that convert multiple sheets into multiple csv file within on click.

For this you need MS OFFICE 1997 or Higher version and window system.

Following are the instructions for convert xls ito csv.

1) Open your xls file in ms excel.
2) Press (ALT+F8), a popup will open.
3) type a name like "ExportSheetsToCSV" and click on "create" button.
4) Now new window will open, delete all data and past following data.
Sub ExportSheetsToCSV()
Dim wSheet As Worksheet
Dim csvFile As String
For Each wSheet In Worksheets
On Error Resume Next
wSheet.Copy
csvFile = CurDir & "\" & wSheet.Name & ".csv"
ActiveWorkbook.SaveAs Filename:=csvFile, FileFormat:=xlCSV, CreateBackup:=True
ActiveWorkbook.Saved = True
ActiveWorkbook.Close
Next wSheet
End Sub


5) Now click on "Run" @ the top.
6) You can get all your csv files from the "c:\users\{username}\my documents\";