Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default using mappoint in Excel VB

I am trying to call this routine to publish a list of pushpins in mappoint.
The application was compiled in VB and works fine, but I want to tie it to
my data in a seamless application and to change a couple of variables like
the radius size and the background color. Can anyone tell me how to call
this app in VB for Excel?

Sub mappoint()
Option Explicit
Dim MpApp As mappoint.Application
Dim Map As mappoint.Map

Private Sub Command1_Click()
Dim DS As mappoint.DataSet
Dim RS As mappoint.Recordset

Set DS = Map.DataSets.Item("My Pushpins")
Set RS = DS.QueryAllRecords
Do Until oRS.EOF
Dim oShp As mappoint.Shape
Set oShp = Map.Shapes.AddShape(geoShapeRadius, _
RS.Location, 7, 7)
Shp.ZOrder geoSendBehindRoads
Shp.Line.Visible = False
Shp.SizeVisible = False
Shp.Fill.ForeColor = vbBlue
ohp.Fill.Visible = True
RS.MoveNext
Loop
End Sub

Private Sub Form_Load()
' Try to attach to running instance of MapPoint
On Error Resume Next
Set MpApp = GetObject(, "MapPoint.Application")
On Error GoTo 0


If MpApp Is Nothing Then
' Attaching failed - try creating an object
On Error Resume Next
Set MpApp = CreateObject("MapPoint.Application")
On Error GoTo 0

If MpApp Is Nothing Then
MsgBox "Could not create MapPoint object"
End
End If
' make the app visible
MpApp.Visible = True
End If

' Ensure MapPoint survives when app terminates
MpApp.UserControl = True

' Retrieve the active map
Set Map = MpApp.ActiveMap
End Sub

End Sub


Thanks

--
Mike


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to MapPoint datamap Lenore Benefield Excel Discussion (Misc queries) 1 October 4th 08 03:51 PM
Excel Versions Compatible with Mappoint 2009? Considering Mappoint Excel Discussion (Misc queries) 2 August 6th 08 02:45 PM
Insert PDF from MapPoint into Excel or Word chrissyb Excel Discussion (Misc queries) 3 December 7th 06 11:21 PM
how do I integrate MapPoint into Excel? 4ldoherty Excel Discussion (Misc queries) 2 June 16th 06 08:58 PM
Uninstall of mappoint has caused errors with excel ChuckW Excel Discussion (Misc queries) 1 August 23rd 05 07:05 PM


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"