santoshloka
Board Regular
- Joined
- Aug 31, 2017
- Messages
- 125
Here is a Website Link
http://www.rcn.montana.edu/resources/converter.aspx
Here is a Excel File link
https://drive.google.com/open?id=1hHHKuIAWU5Qfjt3sJICtHfIQhNn5qrJM
Iam unable to convert Easting, northing to Latitude,Longitude with this code via website link can i get a help with this
http://www.rcn.montana.edu/resources/converter.aspx
Code:
Option Explicit
Sub UTM_Converter()
' Place all your declarations here
Dim i As Long
Dim browobject As Object
Dim obj1 As Object
Dim obj2 As Object
Set browobject = CreateObject("InternetExplorer.Application")
browobject.Visible = False
'Process each row in the excle till the macro meets the last used row
For r = 6 To 9
' Navigate to the URL to process data
browobject.navigate "http://www.rcn.montana.edu/resources/converter.aspx"
' Inform Users about the status
Application.StatusBar = "Macro is converting data. Please wait... Now at Row : " & r & " /// Total Rows : " & Sheets("UTM to LAT LON").Range("C" & Rows.Count).End(xlUp).Row
' As this is dynamic, we have to wait for the browobject to process input and generate output
Do While browobject.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Application.Wait (Now() + TimeValue("00:00:02"))
'Lets populate the form
browobject.document.getElementById("mapDatum").Value = "1"
browobject.document.getElementById("utmZone").Value = "14"
browobject.document.getElementById("utmHemi").Value = "N"
'utmEasting
browobject.document.getElementById("utmEasting").Value = Sheets("UTM to LAT LON").Range("C" & r).Value
'utmNorthing
browobject.document.getElementById("utmNorthing").Value = Sheets("UTM to LAT LON").Range("D" & r).Value
Set obj2 = browobject.document.getElementsByTagName("input")
v_length = 0
While v_length < obj2.Length
If obj2(v_length).Value = "Convert Standard UTM" Then
GoTo comehere
End If
v_length = v_length + 1
Wend
comehere:
obj2(v_length).Click
' Wait while browobject loading...
Do While browobject.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Application.Wait (Now() + TimeValue("00:00:02"))
'Show converted data on the sheet
Sheets("UTM to LAT LON").Range("F" & r).Value = browobject.document.getElementById("decimalLongitude").Value
Sheets("UTM to LAT LON").Range("E" & r).Value = browobject.document.getElementById("decimalLatitude").Value
Next r
' Show browobject
browobject.Visible = False
browobject.Quit
' Clean up
Set browobject = Nothing
Set obj1 = Nothing
Set obj2 = Nothing
Application.StatusBar = ""
'Inform User that entire process was completed
MsgBox "Converted !", vbInformation, "UTM to LAT LON converter v1.0"
End Sub
https://drive.google.com/open?id=1hHHKuIAWU5Qfjt3sJICtHfIQhNn5qrJM
Iam unable to convert Easting, northing to Latitude,Longitude with this code via website link can i get a help with this