+ Reply to Thread
Results 1 to 2 of 2

Disable Macros in Visual Basics

  1. #1
    Registered User
    Join Date
    06-14-2011
    Location
    Houston, tx
    MS-Off Ver
    Excel 2003
    Posts
    1

    Disable Macros in Visual Basics

    I have written a code that will change the excel wordbook and saveas under a document name. I use task scheduler to open the excel sheet daily in order to get and save a daily production summary.

    Is there a way to disable or delete the macro automatically after the macro has ran?

    The following is the visual basic code

    Please Login or Register  to view this content.
    Can I put some type of code before "Application.Quit" to erase this code so the daily summaries that are emailed won't have the macro in it?
    Last edited by JVM383; 06-14-2011 at 05:30 PM.

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

    Re: Disable Macros in Visual Basics

    Rather than run the code in the workbook you intend to email, run it in another workbook (scheduled as you are now). That code can open and operate on the target workbook, which will have no code in it.
    Entia non sunt multiplicanda sine necessitate

+ 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