Export Crosstab Query to Excel

  • Thread starter Thread starter Justin
  • Start date Start date
J

Justin

A customer requires an excell file with each shipment. I can easily create
the data output using a crosstab query. However the customer doesn't want to
see the header row or the first column. Is there a way in VB to delete an
Excel row/column after the data is exported? Can I create a crosstab query
and not display the cloumn and row headings?
 
If you use the TransferSpreadsheet method to export your query:

DoCmd.TransferSpreadsheet acExport, 8, "XtabQuery", "XtabQuery", False,
""

The fifth argument is whether or not to include the column headings in the
first row. As above, use False.


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Thanks for the reply. I tried what yiou suggested , but the column and row
headings are still being exported. Is this because i'm using a crosstab
query?
 
My apologies. I was mistaken. That's what comes from answering too quickly
and not testing. It appears that either way, it exports the field names in
the first row.

Yes, there are ways in VB to delete the first row or to export just the data
to specific cells (which might be preferable). Either way, it requires some
coding.

This resource might be useful:
http://www.accessmvp.com/KDSnell/EXCEL_ImpExp.htm


--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Back
Top