I'm having problems with some code which opens another workbook, does some variuos changes and then saves and closes it. The code i used to open is
This works fine, it opens, does the changes and saves and closes.
But the problem is; if the other workbook is already open, the changes don't take place and it although it closes it comes up with a message box saying the workbook is available for editing etc.
I'm after a change to my code that will open the other workbook if it is not already open and if it is already open will carry on with the edits, save and close
Any ideas would be great
thanks
Code:
Workbooks.Open (backup)
Workbooks(backup).Activate
This works fine, it opens, does the changes and saves and closes.
But the problem is; if the other workbook is already open, the changes don't take place and it although it closes it comes up with a message box saying the workbook is available for editing etc.
I'm after a change to my code that will open the other workbook if it is not already open and if it is already open will carry on with the edits, save and close
Any ideas would be great
thanks