World map embedded in userform.
Indeed you can embed a an image into the entire form or probably better into
an Image control. Click the "Picture" property and browse to your image.
Set AutoSize to true and experiment with PictureSizeMode. Maybe later you
can change Autosize to false.
In the form code (assuming the image control is named Image1)
Private Sub Image1_MouseDown(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Range("A1").Value = X
Range("B1").Value = Y
End Sub
Private Sub Image1_MouseMove(ByVal Button As Integer, _
ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Me.Caption = X & " " & Y
End Sub
You will of course need to calibrate X & Y to relate to your map
coordinates. Assuming the Grid is linear in both axes (don't assume it is),
maybe something like this
With Image1
east = (.Width / X) x (maxEast - minEast)
north = (.Height/ Y) x (maxNorth - minNorth)
End With
where max/min East/north are grid coord's at left, right top & bottom of the
map
Regards,
Peter T
"Paul" wrote in message
...
Hi,
Is it possible to embed a map into a userform? What I'm trying to
accomplish
is that a map, lets say europe, is displayed and everytime when the user
clicks on the map the lat/long coordinates of the pointer are transferred
to
an excel sheet.
Any ideas?
Cheers,
Paul
|