Community of VE/MapPoint Users and Developers
This is a discussion on How to disable the save dialog box within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am using vba from excel 2002(XP) and adding some mappoint functionality. I got it to show the map using ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to disable the save dialog box objApp.ActiveMap.DataSets.ShowDataMappingWizard _ DataSetToUse:=objDataSet, StartPage:=geoDataFieldsPage objApp.ActiveMap.CopyMap Worksheets("Demand_Maps").Select Worksheets("Demand_Maps").Range("e8").Select 'Select e8 Worksheets("Demand_Maps").Paste This puts the pie chart in the Demand_Maps sheet. Now I have two questions : 1. As soon as it copies the map to the sheet .. it shows a Mappoint dialog box with the message 'Save Changes to Map?' . Is there anyway to disable that dialog box so that it does not appear ? 2. It only copies the map to the spreadsheet but not the legends for different colors in the pie chart. But when you use the actual mappoint software it shows the maps with the pie chart and to the left of it is the legends diagram. I would really appreciate your help. Thanks, Reza |
| |||
| Save Dialog box troubles
I'm having a little trouble with turning off the "Save changes to Map?" dialog box as well. I've tried the suggested methods I've seen axMPCtrl.ActiveMap.Saved = true objApp.ActiveMap.Saved = true but haven't had any luck... I'm just using a loop to read in two locations from excel and calculate distance. I get the save dialog box when I execute the line .... Set objLoc2 = objMap.Find(myFind2) and upon exiting the program. Code: Sub Measure_it()
Dim objApp As Object 'MapPoint.Application
Dim objMap As Object 'MapPoint.Map
Dim objRoute As Object 'as MapPoint.Route
Dim objLoc As Object 'MapPoint.Location
Dim objLoc2 As Object 'MapPoint.Location
Dim myAdd, myAdd2, myCity, myCity2, myState, myState2, myFind, myFind2 As String
Dim myZip, myZip2, myRow As Integer
number_rows = Cells(1, 11).Value + 1
On Error Resume Next
For myRow = 2 To number_rows
myAdd = Cells(myRow, 2) 'Use the first column as the address info
myCity = Cells(myRow, 3) 'Use the second column as the city info
myState = Cells(myRow, 4) 'Use the third column as the state info
myZip = Cells(myRow, 5) 'Use the fourth column as the zip info
myAdd2 = Cells(myRow, 6) 'Use the first column as the address info
myCity2 = Cells(myRow, 7) 'Use the second column as the city info
myState2 = Cells(myRow, 8) 'Use the third column as the state info
myZip2 = Cells(myRow, 9) 'Use the fourth column as the zip info
'The first column on the spreadsheet is a blank used for the confirmation info below
Cells(myRow, 1).Value = ""
Cells(myRow, 10).Value = ""
Cells(myRow, 1).Interior.ColorIndex = xlColorIndexNone 'Set background
If Len(myAdd) < 2 Then Exit Sub 'If the address is less than 2 characters, exit
If Len(myAdd2) < 2 Then Exit Sub 'If the address is less than 2 characters, exit
Set objApp = CreateObject("Mappoint.Application")
Set objMap = objApp.newMap 'Create the new map
Set objRoute = objMap.activeRoute
myFind = myAdd & "," & myCity & "," & myState 'Create the address string
myFind2 = myAdd2 & "," & myCity2 & "," & myState2 'Create 2nd address string
Set objLoc = objMap.Find(myFind) 'Find the new address
Set objLoc2 = objMap.Find(myFind2) 'Find the new address
objRoute.Waypoints.Add objLoc
objRoute.Waypoints.Add objLoc2
objRoute.Calculate
Cells(myRow, 10) = objRoute.Distance
If Not objLoc Is Nothing Then 'If found, start processing
Cells(myRow, 1).Value = "Found!" 'Change 1st column to found
Cells(myRow, 1).Interior.ColorIndex = 4 'Change color to Green
Cells(myRow, 2).Select 'Reselect our address field
Else
Cells(myRow, 1).Value = "Not Found!" 'Didn't find the address
Cells(myRow, 1).Interior.ColorIndex = 3 'Set color to red
End If
Set objLoc = Nothing
Set objMap = Nothing
Set objApp = Nothing
Next
On Error GoTo 0
End Sub
-Ryan |
| |||
| Re: How to disable the save dialog box
In order stop the map from asking you to save when you exit your application the method of setting the saved property to true as described above: this.oApp.ActiveMap.Saved = true; will work. i found the best time to call this line of code was on a formClosing event, |
![]() |
| Tags |
| box, dialog, disable, save |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| avoid MP std save dialog?¿? | Nostradamus | MapPoint 2006/2009 Discussion | 3 | 09-08-2004 10:13 AM |
| Disable MapPoint Help in MFC VC++ dialog based application | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-04-2004 10:09 AM |
| Disable save | Dazzer | MapPoint 2006/2009 Discussion | 1 | 10-28-2003 05:30 AM |
| Preventing 'Save As' Dialog (using the OCX!) | daxydoggie | MapPoint 2006/2009 Discussion | 1 | 08-15-2003 03:07 PM |
| How to prevent Save map dialog appearing? | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-21-2002 08:05 PM |