Results 1 to 2 of 2
  1. #1
    AKoval is offline Novice
    Windows Vista Access 2007
    Join Date
    Jan 2013
    Posts
    9

    Marco: Export to Excel w/o Formatting

    Hello. I am running into a conundrum on my database for Access 2007.

    The way I have my database set up is that I have a form that links to a very large table full of data. On the form, all a user needs to do is select an ID, click a button, and then the button will kick off a query, based on the selected ID, and then export that query to Excel. I've done this in two ways.

    Method 1: Created a Output to Macro using the Macro Wizard. I have the Macro exporting to a .xlsx file, BUT the problem I ran into is that Access will export w/formatting, and so only 65,000 rows can be copied over. Considering that some queries will have larger than 65,000 rows, we cannot use this option.



    Method 2: Use Transfer Text to create a CSV file onto the User's C drive. I used this Macro:
    DoCmd.TransferText acExportDelim, , "Carrier Query", "C:\Data.csv", True
    The problem with this is that people are reporting that their file is not exporting to their C drives.

    So my question is, what other option(s) do I have for exporting a query to Excel that I can tie in with a button? I was hoping we could re-visit Method 1 and figure out a way for that macro to work w/o having Access bring in all that formatting in the Excel sheet.

    Thanks for your help!
    Tony

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You might try a different folder. In my experience some OS prevent access to the root drive by default. I'd also try TransferSpreadsheet, though method 2 may work fine.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Formatting text of an export
    By Sarge, USMC in forum Import/Export Data
    Replies: 11
    Last Post: 02-27-2013, 09:08 PM
  2. Excel export formatting
    By tariq nawaz in forum Import/Export Data
    Replies: 0
    Last Post: 09-24-2012, 05:30 AM
  3. Replies: 3
    Last Post: 01-17-2011, 08:13 PM
  4. export with formatting & layout preserves truncations??
    By yinchiao in forum Import/Export Data
    Replies: 0
    Last Post: 04-05-2010, 12:38 PM
  5. Export Formatting
    By arthura in forum Import/Export Data
    Replies: 0
    Last Post: 02-20-2009, 08:44 AM

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