Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2012, 08:41 AM
rossi45 rossi45 is offline VBA Code to force 'Save As' Windows 7 64bit VBA Code to force 'Save As' Office 2007
Novice
VBA Code to force 'Save As'
 
Join Date: May 2012
Posts: 2
rossi45 is on a distinguished road
Default VBA Code to force 'Save As'

I have a 2007 excel .xls file I use as a time sheet record for my employees. They open the file, fill in their hours worked for the week and save to a new location (so they don't overwrite the .xls) At this point, the saving to the new location is done manually by the employee using the 'Save As' button.



The problem I am having is, they sometimes forget to 'Save As' and click 'Save' instead, therefore overwriting my original .xls.

The solution I want to integrate is to write some VBA code to prompt the user to always 'Save As' so from the original .xls so they don't overwrite.

The logic I want is:

  1. Employee opens file and enters data
  2. When they go to save from the .xls, I want a prompt to force the user to 'Save As' to a new location.
  3. If the user has already saved to a new location and they open up the new file in order to edit, then it would be ok to use the 'Save' button at that point.
I've struggled to find some code out there that will do this. If anyone can help, I would appreciate it!


Thanks,
Mike
Reply With Quote
  #2  
Old 05-11-2012, 03:05 PM
macropod's Avatar
macropod macropod is offline VBA Code to force 'Save As' Windows 7 64bit VBA Code to force 'Save As' Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Mike,

If you save the timesheet 'template' as an Excel template, your employees will get a new (non-template) file each time they start a timesheet for a new period. They'll then be prompted for the filename and, even if they don't give one, your template will not be over-written. The file-creation process is a little more convoluted (File|New|My Templates), but that's the price they pay.

One alternative is to set your file's read-only attribute under Windows Explorer. That way, Windows won't allow them to modify the file. Another is to change the file's permissions, so that only you can edit the file, but they can make copies, etc.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Code to force 'Save As' How to force tabs to be consistent PatrickYork Word 1 05-01-2012 07:21 AM
VBA Code to force 'Save As' Code to stop as "save as" if the mail merge has not been done tonywatsonmail Mail Merge 4 04-27-2012 01:57 AM
Force a page break Emaleth9999 Mail Merge 1 02-09-2012 02:36 AM
VBA Code to force 'Save As' Force page setup override jgaffney@hbs.net Word 1 12-16-2011 06:45 AM
VBA Code to force 'Save As' code to save / rename / send attachments unit213 Outlook 1 09-26-2007 08:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft