I have code that creates pivot tables then populates another workbook with data. It opens a workbook that acts as a template for the data, populates it, saves and closes. It does this 8 times for 8 different sets of data. I've run this code many times before without issue and seemingly now it starts to error out with: "Cannot change part of a data table" on the second set of data (the first one works). The section that it is erroring out on is...
'Transfers Repairs Data
Range("D27").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'[VBA Project.xlsm]Repairs Pivot'!R5C8:R60C11,4,FALSE)"
Selection.AutoFill Destination:=Range("D27:D30"), Type:=xlFillDefault
Range("D27:D30").Select
Range("D85").Select
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-1],'[VBA Project.xlsm]Repairs Pivot'!R5C8:R60C11,4,FALSE)"
Any idea whats causing this?