+ Reply to Thread
Results 1 to 4 of 4

macro to print then delete file completely

  1. #1
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    macro to print then delete file completely

    hi guys i have a macro that works well
    after i have pressed the print button i would like it to delete the file completely is this possible rather than manually doing it?
    kind regards

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: macro to print then delete file completely

    excellentexcel,

    This should get you started in the right direction.

    Programming The VBA Editor - Created by Chip Pearson at Pearson Software Consulting LLC
    This page describes how to write code that modifies or reads other VBA code.
    http://www.cpearson.com/Excel/vbe.aspx


    Have a great day,
    Stan
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Contributor
    Join Date
    01-06-2009
    Location
    uk
    MS-Off Ver
    Excel 2007
    Posts
    415

    Re: macro to print then delete file completely

    cant quite see where i should be looking
    i was hoping to press the print macro button and upon closing get vba to delete the file completely and send it to the recycle bin.

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: macro to print then delete file completely

    excellentexcel,

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).
    Tom Urtis

    Please Login or Register  to view this content.
    Yes you can delete an open file or ThisWorkbook active file, and here is how.
    One friendly piece of advice, make damn sure you save a copy of your victim workbook beforehand, in case you change your mind after the suicide code is executed.


    Have a great day,
    Stan
    Last edited by VBA Noob; 03-28-2009 at 05:51 PM.

+ 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