+ Reply to Thread
Results 1 to 11 of 11

SaveChanges Parameter not working with close methods

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    SaveChanges Parameter not working with close methods

    Hello,

    I am trying to open a file, perform some copy paste procedure to another file. After i am done, i want the file to close down without the save prompt window being executed.

    I am using the close method (have tried both windows.close and workbook.close) but the savechanges is not helping.

    Windows(NameModerFil).Close False
    Windows(NameModerFil).Close SaveChanges:=False.

    Any idea what to do? Should this not work?

    Do i need to use the Application.DisplayAlerts method?

    I am using Excel 2003

    Thanks

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

    Re: SaveChanges Parameter not working with close methods

    that ought to work but you could try
    Please Login or Register  to view this content.
    Josie

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

  3. #3
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: SaveChanges Parameter not working with close methods

    Does not work,

    neither does...
    Windows(ImportbookNameFull).Activate
    ActiveWorkbook.Close SaveChanges:=False

  4. #4
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: SaveChanges Parameter not working with close methods

    i Just renamed the file to importbooknamefull

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

    Re: SaveChanges Parameter not working with close methods

    is there any other code in the file that could be interfering? perhaps
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: SaveChanges Parameter not working with close methods

    Please Login or Register  to view this content.
    Last edited by JosephP; 03-20-2013 at 05:36 AM. Reason: add code tags

  7. #7
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: SaveChanges Parameter not working with close methods

    Do you see anything strange? it works with application.displayalerts = false

    However, is it better to use application.enableevents = false?

  8. #8
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: SaveChanges Parameter not working with close methods

    It seems as the file saves itself on default by using enablesevents and displayalters.

  9. #9
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: SaveChanges Parameter not working with close methods

    JosephP,

    For information: I have tested to run the macro from two other colleauges' computers. One running Excel 2003 and the other one running Excel 2010. It works without application.enableevents = false on their computers.

    Really odd!

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

    Re: SaveChanges Parameter not working with close methods

    do you have any add-ins that they do not?

    by the way you don't need to do all that selecting
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    01-31-2013
    Location
    Sweden
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    64

    Re: SaveChanges Parameter not working with close methods

    Great, I'll try that. Thanks!

+ 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