outputto template

supmktg

Registered User.
Local time
Today, 09:03
Joined
Mar 25, 2002
Messages
360
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:

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
 
I've resolved the problem by changing the template and switching from outputto method to transferspreadsheet method.

Thanks,

Sup
 

Users who are viewing this thread

Back
Top Bottom