View Single Post
  #1   Report Post  
Bullet Bullet is offline
Junior Member
 
Posts: 2
Talking

Quote:
Originally Posted by Bullet View Post
When I import web data into a sheet using the VBA XMLImport method in Excel 2007, the user gets a pop up window on the spreadsheet which says "Choose the XML Map to use for this import". The window lists the three maps I've created in the workbook. If you pick the right one, the import completes normally.

But I specified the correct map name in the XMLImport statement using the ImportMap parameter. Why is Excel asking for the map name again???? If you only have one map in the workbook, it will use that map and not ask. But if you have more than one, the user has to select the correct map or cancel the import. Heeeellllllp!
I still have no idea why the ImportMap parameter doesn't work, but what does work is the Import method of the XmlMaps object. If you use something like :
ActiveWorkbook.XmlMaps("My_Map_Name").Import URL:=strURL, Overwrite:=True
Excel will actually use the named map without bothering the user. In this example strURL is a string I created containing the web query.

Last edited by Bullet : November 30th 10 at 12:30 AM Reason: typo