Results 1 to 5 of 5
  1. #1
    krag is offline Medium experience
    Windows 10 Access 2016
    Join Date
    May 2014
    Posts
    71

    Email address hyperlink in exported excel file

    I was using DoCmd RunSavedImportExport in VBA to export query result to .xlsx file.
    Data included email addresses with hyperlink property in table.
    When exported to excel file, email addresses were with hyperlink format in excel file also and there was no problem.
    Example: name@companyname.com

    Recently I upgraded to Office Pro 2016 and also started using DoCmd.TransferSpreadSheet in VBA to export the same query result in table form to .xlsx file.
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, OpenExcelName, FilePathSet & OpenExcelName & ".xlsx"
    Now the email data in excel file is not with hyperlink property but shows like (example):
    name@companyname.com#mailto:name@companyname.com#

    Excel file is used ultimately to send mailshots enbloc to all the email addresses in the excel file and that application is not working now.
    Unable to figure out why this is happening and how to correct this (get proper hyperlink format in excel as before).
    Look forward to help.

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    This is an issue with how Access stores hyperlinks (badly imho!).
    Change the datatype to short text (assuming none of the data exceeds 255 characters) and you'll find Excel will interpret the data as an email address automatically.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    krag is offline Medium experience
    Windows 10 Access 2016
    Join Date
    May 2014
    Posts
    71
    Thanks Minty
    Yes I already tried changing the datatype of the field to short text as suggested.
    However, by doing this, the current data in the field gets converted in the table itself to the long string as mentioned above, instead of just the email address.
    So have to manually edit 5000+ data to bring it to simple email address string.
    If someone could suggest a quick string criteria code by query to remove the string part from # ----- #, it would help.

    For the time being, I have got the data exported to excel file by manually exporting the query result.
    But need to find a permanent solution anyway.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Example: x represents field name

    Mid(Left(x,InstrRev(x,"#")-1), InStr(Left(x,InstrRev(x,"#")-1),":")+1)

    or

    Mid(Left(x,InstrRev(x,"#")-1), InStr(Left(x,InstrRev(x,"#")-1),"mailto:")+7)
    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
    krag is offline Medium experience
    Windows 10 Access 2016
    Join Date
    May 2014
    Posts
    71
    Thanks June7
    That was a big help.

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

Similar Threads

  1. Replies: 4
    Last Post: 08-30-2016, 03:00 PM
  2. Replies: 13
    Last Post: 11-07-2012, 03:14 PM
  3. Replies: 1
    Last Post: 03-15-2012, 05:41 PM
  4. Replies: 5
    Last Post: 02-24-2012, 11:02 AM
  5. to open Exported Excel File
    By waqas in forum Programming
    Replies: 3
    Last Post: 10-16-2011, 12:33 PM

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
  •  
Other Forums: Microsoft Office Forums