Hi there , I'm new to Access and VB i do have so general knowledge in computer and networking but not in programming.

I have a working code that so far export an Access Query into a Excel Template.

I need some advice on how can i improve or clean this code.

Current known problems:

1. Every time i run the export it creates an EXCEL.EXE under Task Manager -> Process.
2. The way this code work is by grabbing an existing excel file with a nice format (Header.xls) add the current query information from (PriceList_STD)and saving it in "pricelist.xls".

The problem is that "pricelist.xls" keep the information from the previous export .

How can i clean the whole sheet before it adds the Query Data ?
Private Sub ExportLocal(ByVal strExcel As String, ByVal rsQ As Recordset)
Dim objXL As Excel.Application
Dim objWkb As Excel.Workbook

Dim objSht As Excel.Worksheet
Dim fRow As Integer
Const strSpace = " "
On Error GoTo errHandler
DoCmd.Hourglass True
Set objXL = New Excel.Application
Set objWkb = objXL.Workbooks.Open(strExcel)
Set objSht = objWkb.Worksheets("Price")
fRow = 7
objSht.Cells(1, 2).Value = "PERFUME " & Format(Date, "dddd, dd MMMM yyyy")
objSht.Cells(5, 2).Value = " PRICELIST "
While Not rsQ.EOF
objSht.Cells(fRow, 1).Value = rsQ!ItemNumber
objSht.Cells(fRow, 2).Value = rsQ!Description
objSht.Cells(fRow, 3).Value = rsQ![Boxes Of]
objSht.Cells(fRow, 4).Value = rsQ!Status
objSht.Cells(fRow, 5).Value = rsQ!StdPrice
fRow = fRow + 1
Dim strExcelPath As String
strExcelPath = "E:\xls\"
Kill strExcelPath & "pricelist" & ".xls"
objWkb.SaveAs strExcelPath & "pricelist" & ".xls"

objXL.Visible = False

Set objSht = Nothing

Set objWkb = Nothing

Set objXL = Nothing

DoCmd.Hourglass False
Exit Sub
MsgBox Err.Description
Resume exitHandler
End Sub

Private Sub cmdExport_Click()
Dim rs As Recordset
Dim db As Database
Set db = CurrentDb
Set rs = db.OpenRecordset("PriceList_STD")
If rs.RecordCount > 0 Then
'Header.xls file must exist in the directory below
If IsFile("E:\xls\" & "Header.xls") Then
ExportLocal "E:\xls\" & "Header.xls", rs
MsgBox "Local template is not found.", vbInformation, "Please select a valid Excel template."
End If
MsgBox "No Records to export.", vbInformation, "Info."
End If
Set rs = Nothing
Set db = Nothing
End Sub