PDA

View Full Version : Automatic update of linked map



Gournis
12-08-2008, 06:08 PM
I am trying to embed a map into an excel file which will automatically update once the datasource has changed. The maps are linked to the excel file in which they are embedded. I don't want to change any settings on the map, simply update them once source data has changed.

What I have so far is below, but it isn't working...any help is much appreciated.



Dim objApp As MapPoint.Application
Dim objDataSet As MapPoint.DataSet
objApp.Visible = True
objApp.UserControl = True

'Open a linked file
Set objDataSet = objApp.ActiveMap.DataSets


'Update the linked set with the source file
objDataSet.UpdateLink

Gournis
12-09-2008, 09:26 AM
Also, is there any good beginner level documentation for vba coding with MapPoint? I found the beginning of this type of material on this site, but it appeared like it wasn't complete.

Jarmin
12-09-2008, 10:33 AM
To quote myself: :rolleyes6: See Help file, there are lots of code snippets, they did a really good job.
I'm not sure, if I get what you mean by "embed a map into an excel file" ...

Gournis
12-09-2008, 10:41 AM
To quote myself: :rolleyes6: See Help file, there are lots of code snippets, they did a really good job.
I'm not sure, if I get what you mean by "embed a map into an excel file" ...

What I mean by "embed a map into an excel file" is that I would like to have an excel workbook that has a MapPoint map in one of the worksheets with data that comes from values within that same Excel workbook.

Thanks for the pointer on the help file. I will check it out. You mean the help file within MapPoint, correct?

Gournis
12-09-2008, 12:58 PM
To quote myself: :rolleyes6: See Help file, there are lots of code snippets, they did a really good job.
I'm not sure, if I get what you mean by "embed a map into an excel file" ...
Thanks to your help, I have figured out how to update the dataset, but I am still having trouble with it updating the map that is embedded in excel. How do I go about activating the map which is embedded/linked in Excel when the OpenMap method says it doesn't work with embedded maps. I have scoured your site and can only find something that talks about doing this in Delphi. Again, thanks for any help/direction you can offer.

JasonS.
12-10-2008, 03:18 PM
Have you read the help file on the DisplayDataMap method? I haven't done what you're trying to do, exactly, but this might give you some ideas.

Gournis
12-10-2008, 03:55 PM
Have you read the help file on the DisplayDataMap method? I haven't done what you're trying to do, exactly, but this might give you some ideas.
Thanks for the suggestion. Unfortunately, this doesn't help with the issue of opening an existing map that is embedded in Excel. It allows you to create a new map but doesn't really help with the whole embedding into Excel challenge.