i'm not using any code for the exportThen you'll need to change your process. As Rey has shown, you can use CopyFromRecordset.
will the headers of the excel file be always the same ?yes
xlObj.workbooks.add <path to template>\yourtemplate.xltyou mean the pre formatted sheet ?x"
xlobj.range("A2").copyfromshall i determine A2:M20 if my templete in this range ?recordset rs
xlObj.activeworkbook.saveawhich new file ?s "c:\mydocuments\newFile.xl sx"
<which new file ? > new file is the name you will give to the excel file with the new recordssorry i confused here , you mean this code will copy the query to a new file first ? ,or directly to my templete ?
1 - What do you mean by "raw height"?sorry , row height
Did you set the formatting in the Column in your Excel template?yes i did
For now, my gut tells me you should import it to a temp excel file, and then load this temp excel file into an the excel file WITH the correct layout, and macro (which only imports the text from the excel file, as text shouldn't adjust your layout except for normal boundaries).