Name

xmlmap.SaveDataSourceDefinition [= setting]

Synopsis

True saves the name of the XML data source in the workbook. False discards the name of the data source. Default is True.

Use the SaveDataSourceDefinition property to prevent the data in an XML map from being refreshed. For example, the following code imports data from the file Numbers.xml but disables the Refresh XML Data button in the user interface:

Set xmap = ThisWorkbook.XmlMaps("Numbers_Map")
fname = ThisWorkbook.path & "\Numbers.xml"
res = xmap.Import(fname, True)
xmap.SaveDataSourceDefinition = False

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.