+ Reply to Thread
Results 1 to 6 of 6

Workbook Expiry date with eviron name bypass

  1. #1
    Registered User
    Join Date
    08-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    57

    Workbook Expiry date with eviron name bypass

    I am hoping to put an expiry date on my workbook, this I can achieve, I was also hoping to set a environ name so if I open the file passed the expiry date the file will open for me only. I have the following 2 pieces of code but can not get them working together, thanks for any assistance.
    HTML Code: 
    Code in Module 1

    HTML Code: 

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Workbook Expiry date with eviron name bypass

    I would try to move your password section:

    Please Login or Register  to view this content.
    to the "Sub Gone ()" sub.

    Then perhaps change your MsgBox to a Userform ... have it display the same user message about expiry but include a commandbutton or maybe just a label that is linked to a password form for your purposes.
    Actually if you decide to do it that way, your password section would be tied to the new commandbutton or label in the userform.

    Make sense ?

  3. #3
    Registered User
    Join Date
    08-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    57

    Re: Workbook Expiry date with eviron name bypass

    Thanks for your reply Logit, I have tried the following but it is not doing anything, not closing the workbook if the username is wrong. Is this how it should be coded to achieve what I want?
    HTML Code: 

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Workbook Expiry date with eviron name bypass

    Look at this example and see what you think ...

    Click the label in the lower left corner as well.
    Attached Files Attached Files
    Last edited by Logit; 12-01-2016 at 12:11 PM.

  5. #5
    Registered User
    Join Date
    08-30-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    57

    Re: Workbook Expiry date with eviron name bypass

    Logit, Thanks for your assistance, I now have this working as I would like, I have included the password section in userform 2 of your attachement and it works as I require, I put a function in to test for the username so that I can match that with password required in userform 2 thanks again for your assistance.
    I will mark this as solved

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Workbook Expiry date with eviron name bypass

    Glad to be of assistance. Thanks.

+ 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. autocalculate expiry date / expiry date colour warnings
    By kimbling1 in forum Excel General
    Replies: 8
    Last Post: 08-27-2014, 02:53 AM
  2. Replies: 0
    Last Post: 06-28-2014, 09:31 AM
  3. [SOLVED] Allocating a given date to a date range bucket: futures contract expiry
    By labogola in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-26-2013, 08:50 AM
  4. [SOLVED] bypass opening workbook prompts
    By slxia1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-01-2012, 04:44 AM
  5. Bypass protected workbook if ...
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2012, 03:05 PM
  6. How can I program macro to bypass a YesNo msgbox from another workbook?
    By SEBS_PARADISE in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-20-2011, 11:19 AM
  7. Bypass Workbook_Open when opening a workbook with VBA
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2005, 04:06 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