Automatically update path for linked xml

sandeepkhans

New Member
Joined
Feb 2, 2022
Messages
1
Office Version
  1. 2019
Platform
  1. Windows
Hi, I am new to using macros. I use xml mapped excel to extract flight planning information. However, when I send the excel and xml files through email to other users, the mapping link does not work obviously.
Is there any way so that when these files are loaded on a new machine, the updated file directory of the xml file is automatically updated in the macro as soon as the excel is opened on the new machine for the first time?

ActiveWorkbook.XmlMaps("FlightPlan_Map").Import Url:= _
C:\Users\Dell\Desktop\FPL_IL\XPS.txt
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hello. Off of the top of my head, you can accomplish this a few ways.

The easiest solution might be to mandate that the excel and xml file are saved in the same folder, and get the path of that folder with ThisWorkbook.Path. That way you can pick up the correct folder no matter where the user saves it.

Second, you could use a FileDialog to prompt the user to open the file (I am unsure if this will work on macOS or not). If you are interested, I can share a sample that I am using.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,726
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top