Results 1 to 6 of 6
  1. #1
    fishhead is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    167

    .csv vs .xls formats

    HI I'm using a RunMenuCommand.ExportExcel function in a macro and it seems to be working fine except it MSAccess allows me to create an .xls file and the application i'm uploading this spreadsheet to requires a .csv formatted version.

    The only way i can see to deal with this is to save the .xls file - reopen it and resave it as .cvs.

    Is there a way to do this without all the extra steps?



    thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why not use TransferText instead in VBA? Example:

    Docmd.TransferText acExportDelim, , "Rates", "C:\Users\Owner\June\Forums\rates.csv"
    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
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    excel files are binary, cvs files are text.
    access CAN create csv files ,(just export as text, but use .csv extension)
    you must create a SPEC file to tell it how to delimit, w or w/o commas.

    docmd.transfertext ....

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Requires a Specification file for acExportFixed.

    Create one by first doing an export with wizard and saving it. In which case might just use txt file extension since data is not comma separated.
    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
    fishhead is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    167
    I like the export with wizard option however the csv version has a bunch of formatting that needs to be removed before it can be used.

    I'm not sure how to do the suggestion pasted below:
    Docmd.TransferText acExportDelim, , "Rates", "C:\Users\Owner\June\Forums\rates.csv"

    where do i put this in my macro - there isn't any function Docmd.TransferText etc


  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    It is VBA code, not macro.
    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.

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

Similar Threads

  1. Allowed Entry Formats
    By billgyrotech1 in forum Access
    Replies: 5
    Last Post: 07-02-2019, 10:06 AM
  2. Copying formats
    By Lesky in forum Reports
    Replies: 1
    Last Post: 04-03-2014, 07:24 PM
  3. Forms and Conditional formats
    By jlgray0127 in forum Forms
    Replies: 11
    Last Post: 10-18-2011, 11:19 AM
  4. Replies: 2
    Last Post: 08-27-2010, 10:11 AM
  5. Queries that Check field formats
    By mojers in forum Queries
    Replies: 3
    Last Post: 05-02-2010, 07:39 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