Hello,
Here i come again with another interesting challenge: to export data from a big number of subfolders , ALMOST each subfolder containing two source excel workbooks, filled with data, and export that data, for every client, in an xml file, for use in another PDF forms. Manually, i change the links in this collector to the next client, and after that, save and export data to xml.
The only problem is there are hundreds of subfolders (clients)

So i began working on this macro, but cannot find yet a way to make the macro search for new link path for the 2 excel files connections in next subfolder . Can you point me to the best way to do this?
Thanks in advance,
Catalin B.
Sub Macrocomandă2()
' I need for this workbook, which is linked to 2 other workbooks, and has atached an xsd schema, to loop through subfolders, changing links, saving and
' exporting data to xml file, in order to import this data to PDF forms
ChDir "E:\Sesiunea 4 - 141-iunie 2011\Acatincai Luminita"
' This, and all other target subfolders is a subfolder of "E:\Sesiunea 4 - 141-iunie 2011\"
' In almost every subfolder, there are 2 workbooks, one with text "plan afaceri" in the file name,
' the other with text "date personale" in the file name
ActiveWorkbook.ChangeLink Name:= _
"E:\Sesiunea 4 - 141-iunie 2011\Acatincai Luminita\141-plan afaceri Acatincăi.xls" _
, NewName:= _
"E:\Sesiunea 4 - 141-iunie 2011\Acatincai Luminita\141-plan afaceri Acatincăi.xls" _
, Type:=xlExcelLinks
' this the old path for the first linked workbook, with text "plan afaceri" in the filename
' I need to set the old link name to the existing link path,
' and the new path name to the excel files in the next subfolder, which contains in the
' file name the text "plan afaceri" for a set of links,
' and "date personale" for the second linked workbook
' If in the next subfolder in range one of the excel files containing in the filename
' "plan afaceri" or "date personale" is missing, the macro should change the links to files in the next subfolder
' this the old path for the second linked workbook, with text "date personale" in the filename
ActiveWorkbook.ChangeLink Name:= _
"E:\Sesiunea 4 - 141-iunie 2011\Acatincai Luminita\Date personale, chestionar, acte necesare 141- Acatincai Luminita.xls" _
, NewName:= _
"E:\Sesiunea 4 - 141-iunie 2011\Acatincai Luminita\Date personale, chestionar, acte necesare 141- Acatincai Luminita.xls" _
, Type:=xlExcelLinks
'After changing the links for "plan afaceri" and "date personale", all i need
'is to execute the folowing commands after every change of links
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.DisplayAlerts = True
ActiveWorkbook.XmlMaps("pdf_121_Asociere").Export URL:= _
"C:\Users\Catalin\Desktop\Cereri finantare\ " & Sheets("Foaie1").Range("b3").Value & "" _
, Overwrite:=True
' Obviously, in B3 there is the client name with &".xml" attached
End Sub