My attached code is causing an error when trying to copy over the worksheet into the new workbook, can anyone advise what might be driving this problem?
Sub Excel1()
Dim rngLoopRange As Range
Dim wsSummary As Worksheet
Dim rngDealers As Worksheet
Set wsSummary = Sheets("PL")
For Each rngLoopRange In Worksheets("AUX").Range("A1:A38")
wsSummary.Range("C12").Value = rngLoopRange.Value
Application.Run "TM1REFRESH"
Dim wb As Workbook
Set wb = Workbooks.Add
ActiveWorkbook.SaveAs filename:=ThisWorkbook.Path & "\"& wsSummary.Range("C12").Value
ws.Copy before:=wb.Worksheets(1)
wb.Close savechanges:=True
Next rngLoopRange
Set wsSummary = Nothing
MsgBox "Complete!", vbInformation
End Sub