Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Test User before saving a file.

What I want to do is put code in the ThisWorkbook...Before Save. My
ultimate goal is to test the user and not allow other users to save the file.
I need for others to view the file but I dont want them to be able to save
it. Also, I dont want to password the file because then I have to input a
password every time. Is there a way to in Before Save say something like:

ReturnNetworkName = Environ("UserName")
If ReturnNetworkName = "TheCorrectID" Then
...allow save
Else
MsgBox "You are not the authorized user to save this file."
Endif

Thank you for your help.

Steven



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Test User before saving a file.

Before save has a cancel argument. Use the code you have and set the cancel
argument as is appropriate. You will probably want to use a function to
determine if the username is in your list of allowable user names...
--
HTH...

Jim Thomlinson


"Steven" wrote:

What I want to do is put code in the ThisWorkbook...Before Save. My
ultimate goal is to test the user and not allow other users to save the file.
I need for others to view the file but I dont want them to be able to save
it. Also, I dont want to password the file because then I have to input a
password every time. Is there a way to in Before Save say something like:

ReturnNetworkName = Environ("UserName")
If ReturnNetworkName = "TheCorrectID" Then
...allow save
Else
MsgBox "You are not the authorized user to save this file."
Endif

Thank you for your help.

Steven



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shared excel (2000) file not saving for one user Dollfacelives Excel Discussion (Misc queries) 4 January 8th 08 08:45 PM
saving the last user who edited the file kman Excel Discussion (Misc queries) 1 February 23rd 06 08:20 AM
Test for file path, alert user and close workbook [email protected] Excel Programming 1 September 21st 05 05:08 PM
Saving a file from a command button with user input Owen[_6_] Excel Programming 2 July 6th 04 10:02 PM
prevent user from saving excel file to a folder susie Excel Programming 2 July 24th 03 09:12 PM


All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"