+ Reply to Thread
Results 1 to 2 of 2

Need VBA Code to Detect File|Share|Email

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Need VBA Code to Detect File|Share|Email

    Hi.

    On workbook open event, I check Windows Login to an admin list on a sharepoint. If the user is an admin, I unprotect all visible sheets. On save event, I reprotect all sheets. But, if the admin does not save the file and does a File|Share|Email, the on_save event never occurs. This will allow an unprotected workbook to be emailed to a non admin.

    How, in VBA, do I detect if the user is trying to email the file from excel so I can reportect all sheets??

    Thanks.
    Steve
    Harrisburg, PA USA

  2. #2
    Forum Contributor mongoose36's Avatar
    Join Date
    06-10-2013
    Location
    Lincoln
    MS-Off Ver
    Excel 2013
    Posts
    389

    Re: Need VBA Code to Detect File|Share|Email

    One idea is to use Custom UI to force any users to use specific predetermined "buttons" to do what needs to be done. With a Custom UI you can all the normal options in the "File" menu, and program your own menu items with buttons for the user to click. This way you have complete control over the order of executions because when the user clicks a...shall we say..."Share this file" button it would execute a code that you create so you could simply hide the needed sheets before the code to share (which you would have to write) runs.
    If your questions has been answered to your satisfaction please don't forget to do the following:

    Add Reputation ... and ... Mark Thread as Solved

    Thanks,

    Ma 10:8b Freely you have received; freely give.

+ 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. Changing file name (Ron de Bruin's email code)
    By dagtwo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-23-2015, 11:47 AM
  2. Code to attach file paths to email
    By petaaalouise in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-22-2015, 02:54 AM
  3. Code for Hyperlink to a File in Email Body
    By natefarm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-05-2015, 12:41 PM
  4. This code doesn't work when when i share the excel file ,,any hints
    By gostavee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-08-2015, 05:13 PM
  5. Need VB Code to Extract email address from File name and email the file
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-30-2012, 11:18 AM
  6. VBA Code to share file and save file
    By brian_2me in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-26-2012, 05:32 AM
  7. Sending excel file email thru VB Code
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2010, 08:21 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