The following code works when I have both the "controls 1" and "main file" open on my PC but these are to be shared workbooks on a common network drive. My code errors out when it gets to the second line (Windows("Main File.xls").Activate) because I don't think I am telling it exactly where to look (ie the proper directory).
Would that make sense? How would I tell it what directory to do to? Or, do you think it's something else?
Private Sub Worksheet_Change(ByVal Target As Range)
Application.Run "'Controls 1.xls'!ThisWorkbook.sortdata"
Windows("Main File.xls").Activate
Application.Run "'Main File.xls'!ThisWorkbook.doagain"
Windows("Controls 1.xls").Activate
ActiveWorkbook.Save
End Sub
Bookmarks