+ Reply to Thread
Results 1 to 8 of 8

Variable day expiry date

Hybrid View

  1. #1
    Registered User
    Join Date
    04-11-2007
    Posts
    49

    Variable day expiry date

    Sub Auto_Open() 
        Dim exdate As Date 
        exdate = "27/06/2007" 
        If Date > exdate Then 
             MsgBox ("This file has expired") 
            ActiveWorkbook.Close 
        End If 
        MsgBox ("You have " & exdate - Date & "Days left") 
    End Sub
    The code expires the file on the basis of a date specified in the macro

    Can this code be modifoed in a manner which will expire the file after certain days on opening of a file say after seven days?

    Alos posted at mrexcel but not getting any reply. Hope someone will help me here.
    http://www.mrexcel.com/board2/viewtopic.php?t=279813

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Thanks for giving the link to your cross post as is required in the rules but you forgot to mention this one!
    Not all forums are the same - seek and you shall find

  3. #3
    Registered User
    Join Date
    04-11-2007
    Posts
    49
    Dear Simon, perhaps you have not read the posts at the forum otherwise you would have seen the difference between the posts. Please dont be hurry in such cross posting replies.

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    The code you supplied is exactly the same the question is very slightly different ergo following the same line of questioning, posters at all these sites may be working towards the same solution for you and it is only fair that the have knowledge of the other posts to see what has or has not been tried!

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    sujittalukder

    You cross post constantly and have been rebuked many times on ozgrid 7 here. I could easily point you to some code posted by my friend jack, but can't be bothered as you can't be bothered to let us know when you cross post.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    RoyUk thanks for the info and support!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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