Need help in exporting table data to excel

af4me

New member
Local time
Today, 05:42
Joined
Nov 9, 2007
Messages
4
Hello,

I am trying to export a table data to excel. Here is the command that I am using:

DoCmd.OutputTo acOutputTable, "table2", acFormatXLS

Data is exported correctly. However, I do not want the field names in the table in access to be exported to excel. Does anyone know how to export the data is a table and not the table filed names. Your help will be appreciated.

Table example
-------------
Field1 Field2 Field 3
Date updated: 4/6/2001
Title: My Title
H1 H2 H3
Name1 1 2
Name 2 3 7

After I export, I get a file with Field1, Field2, Field3 at the top in the excel spreadsheet, I want to exclude the table field names. The excel file should contain only the following:

Date updated: 4/6/2001
Title: My Title
H1 H2 H3
Name1 1 2
Name 2 3 7

Any help will be highly appreciated.

Thanks
 
Have you tried using the DoCmd.TransferSpreadsheet command instead. Within it there is a spot where you can specify whether you get the Field Names or not.
 
Hello Boblarson,

I am sorry for being late and I thank you for taking the time to respond to my post. I tried your suggestion, unfortunately it did not work. I looked in VBA help in access, here is what it says "When you export Microsoft Access table or select query data to a spreadsheet, the field names are inserted into the first row of the spreadsheet no matter what you enter for this argument."

So, I guess I am out of luck now, still looking what I can do. There should be a way.

Thanks
 

Users who are viewing this thread

Back
Top Bottom