+ Reply to Thread
Results 1 to 11 of 11

EXCEL: Save Changes Done By Single Module

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

    EXCEL: Save Changes Done By Single Module

    Dear Experts

    There are Multiple Modules available in my File.

    I' want to save Changes which are done with particular Module only.

    Example:

    Public Sub M()
    xxxx
    xxxx
    xxxx
    xxxx

    SAVE

    End Sub

    -------------------------

    Currently I' am using ThisWorkbook.Save

    But this is saving entire changes done in the file - I' Don't want that.

    Please Help

    Thanks
    MG

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: Save Changes Done By Single Module

    you can only save an entire workbook not a specific set of actions unless you save a copy of the workbook or the affected worksheets (as already stated in your other thread) before your actions are carried out
    Josie

    if at first you don't succeed try doing it the way your wife told you to

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

    Re: EXCEL: Save Changes Done By Single Module

    Thanks for early Reply JOSEPH

    I' got your point..

    So as a workaround do we have any code which will clear all the unsaved history from the file before I' run the module including the save.

    unsaved history should be clear from the last saved action.

    this will be a great help.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: Save Changes Done By Single Module

    you would have to close the file and reopen it-perhaps
    Please Login or Register  to view this content.

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

    Re: EXCEL: Save Changes Done By Single Module

    My Code on Event "Workbook_BeforeClose" only

    Actually I' am Hiding Some Sheets while closing.

    but if the user do not select SAVE option before close, sheets remain unhidden.

    Hence I' am saving the Sheets Hide change force fully - thisworkbook.save

    but .. by this users unwanted changes are also getting saved...

    so I' am thinking to clear all the unsaved history before hiding sheets and then hide sheets and save.

    do you think this will work? and how to use your given code?

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: Save Changes Done By Single Module

    the sheets should get hidden in the beforesave event so that the workbook is always saved with them hidden. then if the user chooses not to save it makes no difference

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

    Re: EXCEL: Save Changes Done By Single Module

    Ohhhhh - K

    I' never know that.. let me Check.

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

    Re: EXCEL: Save Changes Done By Single Module



    Checked the same

    I' put the hide code in beforesave event

    but the sheets are getting hidden with every save...

    even i want to save file and want to continue with some other changes

  9. #9
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: EXCEL: Save Changes Done By Single Module

    that's the point-they have to be hidden with every save and then you unhide them again

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=379

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

    Re: EXCEL: Save Changes Done By Single Module

    Hey Bro.. there you are

    I' have tried the same code.., but file CRASH with particular Scenario

    I' have also logged the issue for the same.. check the following link

    http://www.excelforum.com/excel-prog...ose-event.html

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

    Re: EXCEL: Save Changes Done By Single Module

    If file CRASH will resolve.. I' will use that code only, and remove my existing codes

+ 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