![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: May 2002
Posts: 206
|
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean) a = MsgBox("Save Is Disabled", vbOKOnly) If a = vbOK Then Cancel = True End Sub How do I get out of this file with my changes? Don't laugh. **EDIT** This what I ended up with: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) If ThisWorkbook.Saved = False Then Msg = "Saving Changes Is Disabled In Evaluation Version" Msg = MsgBox(Msg, vbOKOnly + vbExclamation) Cancel = True 'Interupt here when saving this code for the first time. I type "bug" to interupt. 'Debug (delete bug) and reset- then save process will continue. 'In future you can set ThisWorkbook Saved property to True to save changes. End If End Sub [ This Message was edited by: dsnbld on 2002-05-12 20:52 ] [ This Message was edited by: dsnbld on 2002-05-15 06:50 ] |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
|
Why not require a password to save?
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: May 2002
Location: Dallas
Posts: 365
|
dsnbld -
You may be able to do this with a 'SaveAs' rather than a 'Save', but you would either have to rename the file, or save it into another directory. See if this does what you need it to. ~Thomas |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: May 2002
Posts: 206
|
Thanks guys. I don't want the user to save or save as, and I really would prefer not having a password box pop-up.
I have an idea what might could be done, but I'm still learning and don't have the know-how to formulate it. |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: May 2002
Posts: 206
|
Here's my idea. You need a password to save, but password option is only available if the VB window is open. ??
[ This Message was edited by: dsnbld on 2002-05-09 17:27 ] |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Hi dsnbld,
Put this in your ThisWorkbook: Private Sub Workbook(Cancel As Boolean) Dim Msg As String, Ans As String If Not Me.Saved Then Msg = "application was not saved" Msg = Msg & Me.Name & "?" Ans = MsgBox(Msg, vbOKOnly + vbExclamation) Me.Saved = True Exit Sub End If End Sub James |
|
|
|
|
|
#7 |
|
Board Regular
Join Date: May 2002
Posts: 206
|
Thanks for your time James. I think I know what that is supposed to do, however I'm doing something wrong.
|
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
I don't know what your doing wrong. If you want, you can send me your file and i'll
try to fix it for you. James |
|
|
|
|
|
#9 |
|
Board Regular
Join Date: May 2002
Posts: 206
|
Thanks James. I've created a nice template that needs some VB code, and although I had wanted to do it myself, I'm just not ready.
Is it against forum rules to solicite help for hire? I need some other code other than what you tried to help me with. * User must enable macros or else workbook will not open * Disable save as (what you helped me with). So that a user could evaluate the template. I would then send them a new template with save enabled when they decide to buy. * Paste values only as a default for pasting. * Font formatting in certain cells (while sheet protection is on), if this is possible. |
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
|
Hi dsnbld,
Everything you mentioned is very doable, and i'm sure someone will be interested in your offer, i choose not too, i've been helped by numerous people and never been asked for a fee,i see this board as all about learning, helping and sharing, not the $$$. Once it becomes all about $$$ the beauty of this board will be "tits up" > DEAD A few of my teachers in no particular order: Ivan F. Moala Celia Dave Hawley Dax Damon Ostrander "taught me,taught me,taught me" Mark O/Brien Juan Pablo G. Ayladin "the master of formulae" Send it to me, i want to help you no $$$ involved! James _________________ [ This Message was edited by: James on 2002-05-09 20:56 ] [ This Message was edited by: James on 2002-05-09 21:13 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|