The following code opens a workbook called 'Move Files' and runs the macro called 'MoveFiles'
Until yesterday it was working perfectly well for me on 2010 and still works for other users on 2007, 2010 and 365. It no longer works for me though, returning the error
My macros are enabled (unchanged from when the file ran correctly) but it fails when I run on either 2010 or 365. Also any attempt to manually run the 'MoveFiles' macro from this instance of the file also fails, but if I close it down and re-open the 'Move Files' workbook I can successfully run the macro.
It appears as if the call to open the 'Move Files' workbook is disabling the macros for that instance.
Any ideas what is going on and how to resolve it?
VBA Code:
Option Explicit
Sub Open_MoveFiles()
Dim wb As Workbook
Set wb = Workbooks.Open("\\[Folder hierarchy]\Move Files.xlsm")
Application.Run "'" & wb.Name & "'! MoveFiles", 1
wb.Save
wb.Close
Set wb = Nothing
ThisWorkbook.Saved = True
Application.Quit
End Sub
My macros are enabled (unchanged from when the file ran correctly) but it fails when I run on either 2010 or 365. Also any attempt to manually run the 'MoveFiles' macro from this instance of the file also fails, but if I close it down and re-open the 'Move Files' workbook I can successfully run the macro.
It appears as if the call to open the 'Move Files' workbook is disabling the macros for that instance.
Any ideas what is going on and how to resolve it?