Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Mar 2003
    Location
    Gainesville, Florida, USA
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I export a 6 column table to Excel (Access XP)

    Can anyone tell me how I can export a table to an excel spreadsheet without exporting the column names? I'm currently using the transferspreadsheet command.

  2. #2
    Lounger
    Join Date
    Jan 2003
    Location
    Herndon, Virginia, USA
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do I export a 6 column table to Excel (Acc

    The 5th argument for DoCmd.TransferSpreadsheet is a True/False for hasfieldnames. Set this to False (or 0) and the column names won't be exported.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How do I export a 6 column table to Excel (Acc

    When exporting a table or query to Excel, field names are always included; the HasFieldNames argument is ignored.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How do I export a 6 column table to Excel (Access XP)

    Both DoCmd.TransferSpreadsheet and DoCmd.OutputTo include field names in the export.

    The CopyFromRecordset method of the Range object in Excel retrieves the records from a recordset without column headers. You could use Automation (controlling Excel from Access in VBA) to call CopyFromRecordset. Or export to Excel first, then use Automation to remove the header row. Or use Automation to write your own export routine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •