+ Reply to Thread
Results 1 to 2 of 2

Get user email address

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Aberdeen
    MS-Off Ver
    Excel 2016
    Posts
    60

    Get user email address

    Hi all,
    I am trying to get the current user's email address. For the username is use Application.Username. I tried the following code which I found online but it keeps showing an error while opening the workbook (I added this code on a public function in a module which is called when workbook is opening.
    Is there a simpler way to get that info?
    Thank you

    Please Login or Register  to view this content.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Get user email address

    Hi,

    You've tried to write a function that writes a value to a cell. I suspect that's where the error lies.

    Either use a subroutine to write the email address to a cell:

    Please Login or Register  to view this content.
    or write a function and then call that function from a subroutine or from the worksheet..

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Obtain current user email address and populate in a text box on userform
    By Terry Tibbs in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-18-2016, 07:00 AM
  2. VBA - 'submit' macro that attaches to email but allows end user to specify email address,
    By blackburnsexcel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2014, 10:19 AM
  3. outlook vba to prompt user to save email to hard drive if sent to a particular address
    By ohexcel_ineedu in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2014, 10:49 PM
  4. Replies: 1
    Last Post: 03-08-2012, 01:57 PM
  5. Need to modify my code to allow user to input address(es) to email to
    By mrgillus in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-28-2009, 08:16 AM
  6. assign my user name to another email address
    By robert1111 in forum Excel General
    Replies: 2
    Last Post: 07-08-2008, 04:08 AM
  7. Find User Default Email Address in Outlook
    By aph in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-01-2006, 05:41 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1