Hi, I have a button on a form that i wish to export 4 queries into an Excel template, this first one works fine but the following 3 are all blank spreadsheets are created as expected just no data 
here is my code..
Dim XL As Excel.Application
Set XL = CreateObject("excel.application")
Dim RST
Dim vFile
vFile = "Template Location"
Set RST = CurrentDb.OpenRecordset("Query")
With XL
.Visible = False
.Workbooks.Open vFile
.Sheets("Test").Select
.Range("A4").Select
.ActiveCell.CopyFromRecordset RST
.ActiveWorkbook.SaveAs filename:=("Output Location")
.ActiveWorkbook.Close
.Application.Quit
End With
Dim vFile
Dim RST1
vFile1 = "Template Location"
Set RST1 = CurrentDb.OpenRecordset("Query1")
With XL
.Visible = False
.Workbooks.Open vFile1
.Sheets("Test").Select
.Range("A4").Select
.ActiveCell.CopyFromRecordset RST
.ActiveWorkbook.SaveAs filename:=("Output Location ")
.ActiveWorkbook.Close
.Application.Quit
End With
and so on for the others

here is my code..
Dim XL As Excel.Application
Set XL = CreateObject("excel.application")
Dim RST
Dim vFile
vFile = "Template Location"
Set RST = CurrentDb.OpenRecordset("Query")
With XL
.Visible = False
.Workbooks.Open vFile
.Sheets("Test").Select
.Range("A4").Select
.ActiveCell.CopyFromRecordset RST
.ActiveWorkbook.SaveAs filename:=("Output Location")
.ActiveWorkbook.Close
.Application.Quit
End With
Dim vFile
Dim RST1
vFile1 = "Template Location"
Set RST1 = CurrentDb.OpenRecordset("Query1")
With XL
.Visible = False
.Workbooks.Open vFile1
.Sheets("Test").Select
.Range("A4").Select
.ActiveCell.CopyFromRecordset RST
.ActiveWorkbook.SaveAs filename:=("Output Location ")
.ActiveWorkbook.Close
.Application.Quit
End With
and so on for the others