Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Ted Collins   on Feb 03 In MS Office Category.

  
Question Answered By: Wendy Harrison   on Feb 03

Before I get to that, please indulge me with a thought on the XLT versus XLS
issue.

I would definitely use an XLS and make it read only (the file setting) This
will ensure your users  cannot overwrite it with their stuff.

There will only be one way to open it and it will need to be saved under
another name.

Put a macro in the Workbook_open event like this:

Put a file named Windows.txt in F:\CommonFiles\ (or in any directory which
will be mapped the same for all users and change the path in the macro). Then
right click the file, select properties, and make it read only. In fact make
it hidden as well as this will make it much more difficult for them to copy
it.

Don't try it on the final version until you have checked that it works for you
and you are able to open the file again. I forgot the line "Exit Sub" and was
unable to reopen the file so I had to recreate it.

I have chosen the name Windows.txt as something that is unlikely to attract
attention. If you call it "Joes File to stop the excel thingy working.txt" it
will work  just as well but they might wonder why it is there.

Option Explicit

Private Sub Workbook_Open()
On Error GoTo ErrHandler
Dim myFile As String
myFile = "F:\CommonFiles\Windows.txt"
Open myFile For Input As #1
Close #1
Exit Sub

ErrHandler:
MsgBox "You must be connected to the network  to use this workbook"
ThisWorkbook.Close False

End Sub

Share: 

 

This Question has 27 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Restrict workbook to network Or get search suggestion and latest updates.


Tagged: