WillyBootstrap
New member
- Local time
- Today, 10:17
- Joined
- Dec 12, 2013
- Messages
- 3
Hi.
This has been an issue i've seen that in most forums, people find no solutions for it "Editing a saved import or export specification XML through vba" After a thorough researching on the topic, I found a piece of code from stackoverflow
(Not much post count. So cant post a link!
)
I need to change the location for a few saved imports. I've customized the code for my use as follows
Here imex is the saved import as sent from the calling function.
myPath is the string which which stores the new location for saved import.
Replace function replaces in the XML, the Path from old (strFind) to new(myPath).....for import address.
The problem is with strFind.
According to what I come up with, strFind is the old location (Path) for the saved import. But I have no clue as how can I find this value!
It is no where mentioned what it is.
Can anyone please explain how to find the current import location for a savedImport?
Edit: I tried providing strFind manually as "C:\Users\Willy\Documents\InputFolder\input.csv" (location for for saved import file) and this code works perfectly. But the question still remains, how to find the current import location for a savedImport?
This has been an issue i've seen that in most forums, people find no solutions for it "Editing a saved import or export specification XML through vba" After a thorough researching on the topic, I found a piece of code from stackoverflow
(Not much post count. So cant post a link!

I need to change the location for a few saved imports. I've customized the code for my use as follows
Code:
Function changeImportSpecs(imex As String, strFind As String, myPath As String) As String
Dim mySpec As ImportExportSpecification
Set mySpec = CurrentProject.ImportExportSpecifications.Item(imex)
mySpec.XML = Replace(mySpec.XML, strFind, myPath)
End Function
Here imex is the saved import as sent from the calling function.
myPath is the string which which stores the new location for saved import.
Replace function replaces in the XML, the Path from old (strFind) to new(myPath).....for import address.
The problem is with strFind.
According to what I come up with, strFind is the old location (Path) for the saved import. But I have no clue as how can I find this value!
It is no where mentioned what it is.
Can anyone please explain how to find the current import location for a savedImport?
Edit: I tried providing strFind manually as "C:\Users\Willy\Documents\InputFolder\input.csv" (location for for saved import file) and this code works perfectly. But the question still remains, how to find the current import location for a savedImport?
Last edited: