MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How to disable the save dialog box

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-22-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
How to disable the save dialog box

I am using vba from excel 2002(XP) and adding some mappoint functionality. I got it to show the map using the following code .

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 02-22-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Hi Raza,

For disabling the save dialog box please use

axMPCtrl.ActiveMap.Saved = true;

U can use it prior to loading of new map.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-02-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
Any thoughts would be greatly appreciated. Thanks.

-Ryan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-02-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Figured it out

Hey guys,

Nevermind... I figured it out...

I needed ... objRoute.Clear
so that I could use the route repeatedly and just initiate the map once at the start of my program.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 11-06-2006
Junior Member
White Belt
 
Join Date: Nov 2006
Posts: 9
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,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
box, dialog, disable, save


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
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
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


All times are GMT -5. The time now is 03:57 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54