Export Crosstab Query to Excel

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?
 
R

Roger Carlson

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
 
J

Justin

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?
 
R

Roger Carlson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top