Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2011
    Posts
    2

    Unanswered: Automatic export query to (formatted) Excel

    Hi Access giants,

    I would like to run a query in Access (button on a form) with the possibility to automatically export the results to a formatted Excel file with functions like 'wrap text', colored headings etc. I also noticed that for example values (columns) with type 'time' are shown as 1-1-1900 in excel after export.
    Who can help me out?

    Thanks all in advance for your help.

    Cheers,

    Rob, Belgium

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    For this sort of export, I generally use a recordset to hold the data going out, use the Excel library to allow Access to control Excel objects and a loop to populate the spreadsheet.

    You can then create a new workbook object, pick a sheet from that workbook and format it how you need, and control which fields from the recordset go where in the worksheet.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  3. #3
    Join Date
    Sep 2011
    Posts
    2

    Thanks!

    Thanks for your help! You've saved me

  4. #4
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    You're welcome! Glad to know that it helped
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Tags for this Thread

Posting Permissions

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