Results 1 to 5 of 5
  1. #1
    BR549's Avatar
    BR549 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    21

    Export Worksheet Labels

    Hello Margaret, it's me again. (Sorry lame reference to "The Streak", by Ray Stevens.



    When exporting a worksheet the worksheet name has a _ (underline), rather than a space and any special characters are also replaced by an _ (underline). Is it possible to show the worksheet with the space and the special characters using access?

    DoCmd.TransferSpreadsheet acExport, 10, "tbl A Path", strPath, True, "A Path"

    A Path is what I would like it named.

    Underlines bug me man...
    Thank you

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    Common advice is to not use spaces and special characters/punctuation (underscore is exception) in Access naming convention.

    If TransferSpreadsheet makes those changes, can't do anything about it other than to rename the file once it's created.

    Characters that cannot be used in Windows file names: < > : " / \ | ? *
    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
    BR549's Avatar
    BR549 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    21
    Right, but this would be the worksheet label in the workbook. It allows the _ and some other special characters.

    If it doesn't, then I will have to create macros to rename the worksheets in the workbook.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,901
    That would require VBA code that opens the Excel file as an object and manipulates the object.
    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
    BR549's Avatar
    BR549 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    21
    Thank you for the help, I will write Macro's in excel after the file has been exported to make the needed changes.

    I think we can stick a fork in this one.

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

Similar Threads

  1. Export Form And Subform Data To Excel Form Same Worksheet
    By tomtheappraiser in forum Import/Export Data
    Replies: 6
    Last Post: 08-12-2013, 10:39 AM
  2. Delete Contents of worksheet before export - xlWSh.Cells.Select
    By allenjasonbrown@gmail.com in forum Programming
    Replies: 1
    Last Post: 10-14-2012, 10:38 PM
  3. export query to hidden excel worksheet
    By allenjasonbrown@gmail.com in forum Programming
    Replies: 3
    Last Post: 10-14-2012, 12:39 PM
  4. VBA to Import Excel Worksheet
    By bdaniel in forum Programming
    Replies: 2
    Last Post: 11-23-2010, 10:53 AM
  5. Importing the second excel worksheet
    By geoffwbailey in forum Programming
    Replies: 1
    Last Post: 06-25-2010, 12:16 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