Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Protect file on a shared Network drive

I place a file on a network drive which is available to all
users.

I tell the users to copy the file to their own drive (either
network or local) and open the copy there. If they do so,
then code in the ThisWorkbook module will complete the
process.

By placing the file centrally on the common network
drive, I figure that updates will be easier to manage,
but, two questions please:

1. Can I detect the file being opened from its's
original location, and stop code executing,
prompting user to first copy the file.
2. Can I stop user from modifying the file's
properties (eg name) because that might
cause me a few problems!

I'm trying to introduce new users to a few little macros.
Longer term, when they're more comfortable, it will be
far better distributed as an addin, but until then.......?

Distributed under Excel 2003 and XP Pro.

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Protect file on a shared Network drive

Hi Stuart,

Stuart wrote:
I place a file on a network drive which is available to all
users.

I tell the users to copy the file to their own drive (either
network or local) and open the copy there. If they do so,
then code in the ThisWorkbook module will complete the
process.


Instead of telling users to copy the file to their local drive, you could
force the issue with ThisWorkbook.SaveCopyAs.

By placing the file centrally on the common network
drive, I figure that updates will be easier to manage,
but, two questions please:

1. Can I detect the file being opened from its's
original location, and stop code executing,
prompting user to first copy the file.


You could check ThisWorkbook.Path and see if it matches the network
location. If so, display a message and stop executing.

I would also recommend making the workbook read-only. In addition, if you
have the ability to set NTFS permissions, you should set them in such a way
that the workbook cannot be modified by any of the users. Because if the
user disables macros, they will be able to do whatever they want with the
workbook (including modifying and resaving).

2. Can I stop user from modifying the file's
properties (eg name) because that might
cause me a few problems!


No. You can protect aspects of the workbook (such as worksheet names, range
values, etc), but you cannot stop them from renaming the workbook. You
should try to make your code as generic as possible and avoid referring to
workbook and sheet names.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Protect file on a shared Network drive

Thanks for the ideas.

Regards.

"Jake Marx" wrote in message
...
Hi Stuart,

Stuart wrote:
I place a file on a network drive which is available to all
users.

I tell the users to copy the file to their own drive (either
network or local) and open the copy there. If they do so,
then code in the ThisWorkbook module will complete the
process.


Instead of telling users to copy the file to their local drive, you could
force the issue with ThisWorkbook.SaveCopyAs.

By placing the file centrally on the common network
drive, I figure that updates will be easier to manage,
but, two questions please:

1. Can I detect the file being opened from its's
original location, and stop code executing,
prompting user to first copy the file.


You could check ThisWorkbook.Path and see if it matches the network
location. If so, display a message and stop executing.

I would also recommend making the workbook read-only. In addition, if you
have the ability to set NTFS permissions, you should set them in such a

way
that the workbook cannot be modified by any of the users. Because if the
user disables macros, they will be able to do whatever they want with the
workbook (including modifying and resaving).

2. Can I stop user from modifying the file's
properties (eg name) because that might
cause me a few problems!


No. You can protect aspects of the workbook (such as worksheet names,

range
values, etc), but you cannot stop them from renaming the workbook. You
should try to make your code as generic as possible and avoid referring to
workbook and sheet names.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004


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
Saving Excel File to a Network Drive Jason Excel Discussion (Misc queries) 2 March 2nd 10 05:16 PM
Shared Excel Files on Network Drive Jay[_5_] New Users to Excel 1 September 4th 08 12:35 PM
excel 2003 file converted to .xlsm file when save to network drive Chris Excel Discussion (Misc queries) 3 January 23rd 08 02:56 PM
Unable to overwrite file to network drive Airmon Excel Discussion (Misc queries) 1 November 4th 05 02:28 PM
Can't one excel file on network drive? Mesak Excel Discussion (Misc queries) 0 October 11th 05 09:58 AM


All times are GMT +1. The time now is 05:09 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"