Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export to excel wo headings

Status
Not open for further replies.

xkidd

Technical User
Jun 4, 2003
9
0
0
I'm using the transfer spreadsheet function to create a file in excel, but i do not want the headings to show up in the excel file just the data..any ideas?
 
From the help file:
docmd.TransferSpreadsheet(TransferType, SpreadsheetType, TableName, FileName, ====>HasFieldNames, Range, UseOA)

HasFieldNames Optional Variant. Use True (–1) to use the first row of the spreadsheet as field names when importing or linking. Use False (0) to treat the first row of the spreadsheet as normal data. If you leave this argument blank, the default (False) is assumed. 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.

 
Yeah but.....

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.

and this is what i am trying to avoid....
 
After you've exported to excel, why not just open it up then delete the first row using VBA? Off the top of my head, something like ...

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open(FILE_NAME)
xlBook.Worksheets(1).Cells(1, 1).entirerow.delete
xlBook.Save
xlBook.Close
 
I've never had any problem getting the field names to appear or not appear as commanded. Are you sure they are in row 1?
 
thanks for the tips...thats pretty much what i decided to do...i'm running a code from excel thru an Access module...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top