+ Reply to Thread
Results 1 to 4 of 4

EXCEL: ThisWorkbook.Save Not Working While Deleting All VBA Codes

  1. #1
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    EXCEL: ThisWorkbook.Save Not Working While Deleting All VBA Codes

    Dear All

    In my Excel file I' am having many Modules, Sheet Level Code & Workbook Level Codes.

    I' am using on CommandButton calling a module which is Clearing all the Codes from Sheet, WorkBook, Modules and also Deleting Modules.

    I' want to auto save the file with "ThisWorkbook.Save" once all the codes and module is deleted.

    As there are chances that user will not save the file after running this module, which is causing the code to remain in file.

    This is what not working and I' am not able to save the file Automatically.

    Code is working properly, just not able to AUTO SAVE the file.

    Please help me on this.

    I' AM USING BELOW MODULE TO DELETE CODES.

    Please Login or Register  to view this content.

    Thanks
    MG
    Last edited by [email protected]; 05-14-2013 at 06:41 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: EXCEL: ThisWorkbook.Save Not Working While Deleting All VBA Codes

    Is it deleting this routine which is causing it?

  3. #3
    Forum Contributor
    Join Date
    12-28-2012
    Location
    Mumbai - India
    MS-Off Ver
    Excel
    Posts
    145

    Re: EXCEL: ThisWorkbook.Save Not Working While Deleting All VBA Codes

    Yeah!

    But if it is running till the End Sub

    If I' put MsgBox instead of ThisWorkbook.Save

    I' am able to get the message.

    But I' don't know why it is not saving the file.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: EXCEL: ThisWorkbook.Save Not Working While Deleting All VBA Codes

    can you attach it?

+ 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