Thanks for taking the time to do this - unfortunately it's still giving me the error messages and stopping the code.
I'm beginning to think this may not be possible - in theory one way around it would be to create a dummy data file under the name/path of the currently assigned data source before opening the document - the doc would then be able to find it when opened and not give any errors, and then I could then assign the datasource I really wanted.
The problem with that is that I don't think there's a way of getting the path to the current data source without opening the doc first, and then we're back to all the errors messages!
|