+ Reply to Thread
Results 1 to 13 of 13

Automatic save on close but no pop up

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Automatic save on close but no pop up

    Ok guys, normally this works for me but apparently I have an error in my code because I still get the pop up in excel.
    I'm missing something but can not see it.
    Hopefully one of you can see it.
    Don't mind all the code in beginning because that still needs cleaning and tweaking.
    Its in the part of display alerts...

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Automatic save on close but no pop up

    Please Login or Register  to view this content.
    This is what I use in Word 2007 and it doesn't ask me to save changes.
    You just have to change wdDoNotSaveChanges in to xlDoNotSaveChanges or what excel uses... I don't know that part, sry.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Automatic save on close but no pop up

    thanks stojko89 I tried with xl but unfortunately excel 2007 still asks me if I want to save or not so it does not work.

  4. #4
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Automatic save on close but no pop up

    Ok so I tryed this and it works:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Automatic save on close but no pop up

    Yes that is also what i would expect.
    But apparently something else in the whole code prevents it in some way...

    Also I want the code to save before close. Not to not save.
    Change in your code False to True and you will also get a pop-up.

  6. #6
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Automatic save on close but no pop up

    Hmm tryed changing to True and it saves and closes with no pop up

  7. #7
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Automatic save on close but no pop up

    hmmm then something else is the problem. U are using excel 2007? And the excel you are trying to close is a .XLSX file?

  8. #8
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Automatic save on close but no pop up

    Please Login or Register  to view this content.
    I've Changed the last 3 lines of the code fo you disable alerts close and enable alerts
    try this

  9. #9
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Automatic save on close but no pop up

    Thanks but still no luck. For both workbooks I get a pop up asking me if i want to save the workbook....

  10. #10
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Automatic save on close but no pop up

    Please Login or Register  to view this content.
    Maby the problem is that you want to activate them after display alrert disable.
    Try this, if this doesn't work, then I don't know and I hope someone else answers your question.
    Sorry.

  11. #11
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Automatic save on close but no pop up

    nope sorry stojko89. It needed to be Workbooks and one savechanges was missing an s, but still no luck.
    Ik keeps asking if it should save.
    Thanks for your effort!

  12. #12
    Forum Contributor
    Join Date
    07-26-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2016 Office 365 ProPlus
    Posts
    826

    Re: Automatic save on close but no pop up

    ok I found out what the problem was.
    SaveChanges:=True is not enough, I also needed to specify Filename so Filename:="xxxxxxx.xlsx"

    I will paste the part of code here for people that are interested:

    Please Login or Register  to view this content.

  13. #13
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Automatic save on close but no pop up

    Ah... wouldn't have guessed it However in my codes I set the folder and file name on the top of the code so then savechanges=True is enough :D oh well. Glad it worked for you!

+ 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