Everytime I run this macro it shuts down Excel. I get a pop up box saying "Microsoft Excel has encountered a problem and needs to close. We are sorry for the inconvenience."
The thing is, it runs at first and I seem to get this error when it gets to the 'Next' line in the macro.
Is there something in my code that would cause Excel to shut down like this?
Code
Sub Update_template()
For x = 44 To 45
Workbooks("budget macros").Activate
Sheets("Sheet1").Select
Range("B" & x).Select
Dim Location, Thisfile, file_name, folder, file As String
Location = "X:\East\"
file_name = Range("F" & x)
folder = Range("E" & x)
file = folder & "\" & "Bud08 " & file_name & " Prop Budget.xls"
Thisfile = Location + file
Workbooks.Open Filename:=Thisfile, UpdateLinks:=False, Editable:=True
Sheets("Revenue").Select
Range("j52").Select
Selection.Interior.ColorIndex = 19
Range("q53").Select
Selection.Interior.ColorIndex = 19
ActiveWorkbook.Save
ActiveWorkbook.Close
Workbooks("budget macros").Activate
Sheets("Sheet1").Select
Next
MsgBox ("done")
End Sub
Display More