Hi All,
I have created and saved an excel template "Report1.xlt" with a Header and a Footer. I want to export a query to excel using this template. I am exporting the query using the following code:
The excel file is not using the "report.xlt" template. Can anyone tell me why this might be happening? Is there a better way of doing this?
Thanks,
Sup
I have created and saved an excel template "Report1.xlt" with a Header and a Footer. I want to export a query to excel using this template. I am exporting the query using the following code:
Code:
Dim stQryName As String
Dim stTemplate As String
stQryName = "qryReport"
stTemplate = "C:\Template\Report1.xlt"
DoCmd.OutputTo acOutputQuery, stDocName, "MicrosoftExcel(*.xls)", Me.txtSaveFile, , stTemplate
The excel file is not using the "report.xlt" template. Can anyone tell me why this might be happening? Is there a better way of doing this?
Thanks,
Sup