MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

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 Feb 21st, 2002, 07:58 AM   #1
nicademas
New Member
 
Join Date: Feb 2002
Posts: 3
Default

Is there any way to write a macro which can prevent computer illiterate users from saving their files EVERYWHERE??

Thanks,
nica
nicademas is offline   Reply With Quote
Old Feb 21st, 2002, 08:28 AM   #2
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

Quote:
On 2002-02-21 06:58, nicademas wrote:
Is there any way to write a macro which can prevent computer illiterate users from saving their files EVERYWHERE??

Thanks,
nica
By EVERYWHERE, do you mean that the users just save the workbook in whatever directory/folder they happen upon? Or do you mean that you don't want the user to sve the workbook at all?

To stop the user from saving the workbook at all you can do this:

1. Right click on the XL sheet icon to the left of the "File" menu, choose "View Code".
2. Copy and Paste this code:


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Me.Saved = True
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Cancel = True
End Sub

That will stop them from saving (assuming that they don't turn off macros at startup).

Forcing the user save in a specific directory is a bit more tricky. If this is what you want to do then let me know what the full path of the directory is and I can code this if you want. e.g. "C:TempMyImportantFiles"


_________________
Mark O'Brien

[ This Message was edited by: Mark O'Brien on 2002-02-21 07:32 ]
Mark O'Brien is offline   Reply With Quote
Old Feb 21st, 2002, 05:37 PM   #3
nicademas
New Member
 
Join Date: Feb 2002
Posts: 3
Default

I need them to be only able to save - in the directory they open it from & not save-as becasue they tend to put the files in the strangest places & very valuable data is lost.

Thanks so much!
Nica
nicademas is offline   Reply With Quote
Old Oct 3rd, 2006, 03:30 PM   #4
salcampbell
New Member
 
Join Date: Oct 2006
Posts: 2
Default

please explain how to perform your first point - do not want them to be able to "save as" only "save." thanks
salcampbell is offline   Reply With Quote
Old Oct 3rd, 2006, 03:33 PM   #5
Cbrine
Board Regular
 
Cbrine's Avatar
 
Join Date: Dec 2003
Location: Brampton
Posts: 3,185
Default

Nica,
The easiest way would be to customezie each of the users toolbars and remove the saveas option and button. This would prevent "illiterate" users from saving everywhere.

The first save of a file would be prompted for a folder, then they would only be able to overwrite the current file name.

HTH
Cal

PS-I would recommend training the users vs. limiting thier access to functionality, so I hope you have a good reason.
__________________
Xcelerated Solutions
Office Automation Solutions for the Toronto Area
Cbrine is offline   Reply With Quote
Old Oct 3rd, 2006, 03:53 PM   #6
salcampbell
New Member
 
Join Date: Oct 2006
Posts: 2
Default

our agency is too large to do that, they create copies of the original file...isn't there a way to use macros to do something
salcampbell is offline   Reply With Quote
Old Oct 3rd, 2006, 04:53 PM   #7
Cbrine
Board Regular
 
Cbrine's Avatar
 
Join Date: Dec 2003
Location: Brampton
Posts: 3,185
Default

Nica,
If you are talking about a single file, and the user security is set to medium, this would be possible, but to limit all users save options for all files, it would have to be on a single PC basis.

HTH
Cal
__________________
Xcelerated Solutions
Office Automation Solutions for the Toronto Area
Cbrine is offline   Reply With Quote
Old Jan 31st, 2007, 05:51 PM   #8
Mark O'Brien
MrExcel MVP
 
Mark O'Brien's Avatar
 
Join Date: Feb 2002
Location: Columbus, OH, USA
Posts: 3,519
Default

I just got a great question via PM.

"How do you add the code that I suggested to a workbook and then save it?"

The easiest answer is to do the following:

After you have made the code changes you need to make.

1. Go to View|Toolbars and choose "Visual Basic"
2. Toggle the 6th control from the left "Design Mode"
3. Save your workbook
4. Close and reopen the workbook. Design mode should be off.
Mark O'Brien is offline   Reply With Quote
Old Apr 13th, 2007, 08:32 AM   #9
Jorne
New Member
 
Join Date: Oct 2006
Posts: 42
Default

These codes works fine thanks.

But how do you prevent users from taking the file (without opening it) and copy paste it to somewhere else?
Jorne is offline   Reply With Quote
Old Nov 7th, 2007, 08:15 AM   #10
TobiasTokio
Board Regular
 
Join Date: Mar 2006
Location: Munich
Posts: 262
Default

But is it still possible to save the workbook with a macro function?
TobiasTokio 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 01:43 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