Hello folks,
First off thanks for the help on my previous post..
I have an Exel 2010 workbook that I want people to fill out and print, but do not want Save or Save As function. I located the following, and it seems to work for me, but once I add it I can no longer save the file
How can i save the file while this code is entered in?Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean) Cancel = True MsgBox "This file can not be saved - complete and print !" End Sub
Wouldn't it be simpler to just remove the entries before saving?
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Hi Todd, your post gave me an early morning laugh, thanks.
To answer your question this macro turns events on and off. If you run it to turn events OFF you'll be able to save your workbook just fine. Run the macro again afterwards to turn events back ON.
Sub Flip() Application.EnableEvents = Not (Application.EnableEvents) If Application.EnableEvents Then MsgBox "Events ON" Else MsgBox "Events OFF" End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks