Results 1 to 9 of 9
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    header for excel spreadsheet


    Are you able to create a header record when exporting a query into a spreadsheet? Thank you in advance!!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    How are you doing the export? The export wizard will take the table/query fields as the header row for the spreadsheet.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Using this VBA code,
    DoCmd.TransferSpreadsheet acExport, 8, "qryExportMSR", "c:\production\QOH-Title.xls", True, ""

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    The True argument tells the code to send the field names as the first row. Is that not working?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Yes, the field names are working properly. I'm trying to place a report title and date of printing before the field names and data. That's why I was checking to see if their is a way to create a header for the spreadsheet.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    Not with the wizard or TransferSpreadsheet methods. You could have additional VBA code to modify the spreadsheet once it is created to insert rows and text into cells.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    OK. could you point me in that direction?

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,900
    First declare workbook and worksheet objects then insert rows and insert values to cells. Start with:
    http://www.java2s.com/Code/VBA-Excel...ctvariable.htm
    http://www.anthony-vba.kefra.com/vba/vbabasic2.htm
    http://bytes.com/topic/access/answer...ccess-using-vb

    Attempt code and post for analysis if you have issue.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks. I'll look at these links tonight.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. import excel spreadsheet though outlook
    By bopsgtir in forum Import/Export Data
    Replies: 0
    Last Post: 03-18-2011, 09:07 AM
  2. Email Excel Spreadsheet from Access
    By Nancy in forum Access
    Replies: 2
    Last Post: 11-09-2010, 02:37 PM
  3. Pivot Table from Excel Spreadsheet
    By Cgil32 in forum Access
    Replies: 0
    Last Post: 08-26-2010, 05:18 PM
  4. importing excel spreadsheet issues
    By majortool in forum Import/Export Data
    Replies: 1
    Last Post: 01-24-2008, 06:29 PM
  5. Type error when importing Excel spreadsheet
    By jlmnjem in forum Database Design
    Replies: 2
    Last Post: 08-27-2006, 07:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums