+ Reply to Thread
Results 1 to 4 of 4

Trial Period of Workbook then delete file is not working

  1. #1
    Forum Contributor
    Join Date
    12-22-2006
    Posts
    114

    Trial Period of Workbook then delete file is not working

    I have the following code which should have deleted

    Please Login or Register  to view this content.
    And today when I opened the file it came up with a runtime error 1004 ChangeFileAccess Denied. (not great as I sent this to loads of people hoping it would delete today! lol) Does this formula need the read only line in it and is this the simplest code to just make the file delete itself if todays date is beyond the one stated?

    Anyway, your help would be much appreciated.

    Thanks in Advance,

    Alex

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

    Re: Trial Period of Workbook then delete file is not working

    If I remember correctly you can't use Kill on an open file
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Trial Period of Workbook then delete file is not working

    If the file is opened read-only then the code will raise an error. So,

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Trial Period of Workbook then delete file is not working

    BTW, if the file itself is read-only (as opposed to being opened read-only), you need to change that attribute before the Kill statement.

+ 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