MrExcel Message Board


Go Back   MrExcel Message Board > Question Forums > Excel Questions

Notices

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old May 9th, 2002, 02:36 PM   #1
dsnbld
Board Regular
 
Join Date: May 2002
Posts: 206
Default

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 ]
dsnbld is offline   Reply With Quote
Old May 9th, 2002, 02:43 PM   #2
lenze
MrExcel MVP
 
lenze's Avatar
 
Join Date: Feb 2002
Location: Helena, MT
Posts: 13,690
Default

Why not require a password to save?
lenze is offline   Reply With Quote
Old May 9th, 2002, 03:40 PM   #3
Thomas
Board Regular
 
Join Date: May 2002
Location: Dallas
Posts: 365
Default

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
Thomas is offline   Reply With Quote
Old May 9th, 2002, 04:58 PM   #4
dsnbld
Board Regular
 
Join Date: May 2002
Posts: 206
Default

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.
dsnbld is offline   Reply With Quote
Old May 9th, 2002, 05:27 PM   #5
dsnbld
Board Regular
 
Join Date: May 2002
Posts: 206
Default

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 ]
dsnbld is offline   Reply With Quote
Old May 9th, 2002, 05:42 PM   #6
James
Board Regular
 
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
Default

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
James is offline   Reply With Quote
Old May 9th, 2002, 07:15 PM   #7
dsnbld
Board Regular
 
Join Date: May 2002
Posts: 206
Default

Thanks for your time James. I think I know what that is supposed to do, however I'm doing something wrong.
dsnbld is offline   Reply With Quote
Old May 9th, 2002, 07:28 PM   #8
James
Board Regular
 
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
Default

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
James is offline   Reply With Quote
Old May 9th, 2002, 08:31 PM   #9
dsnbld
Board Regular
 
Join Date: May 2002
Posts: 206
Default

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.
dsnbld is offline   Reply With Quote
Old May 9th, 2002, 08:44 PM   #10
James
Board Regular
 
Join Date: Feb 2002
Location: Huntington Beach, CA USA
Posts: 327
Default

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 ]
James is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 09:04 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes