Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default Setting an Open-file password

Hi All,

Can anyone assist me in the code I need to write to password protect a file
so that the user is prompted for a password when attempting to open the file.

Kind Regards,

Terry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Setting an Open-file password

Hi Terry

no code needed, save the file using file save as ... choose tools in the
dialog box toolbar, general options - and you can then set a password to
open and /or a password to modify.


--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Terry" wrote in message
...
Hi All,

Can anyone assist me in the code I need to write to password protect a
file
so that the user is prompted for a password when attempting to open the
file.

Kind Regards,

Terry



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default Setting an Open-file password

Hi Julie,

The excel file is created in an automated process from DTS within MSSQL 2000.

Thanks,
Terry

"JulieD" wrote:

Hi Terry

no code needed, save the file using file save as ... choose tools in the
dialog box toolbar, general options - and you can then set a password to
open and /or a password to modify.


--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Terry" wrote in message
...
Hi All,

Can anyone assist me in the code I need to write to password protect a
file
so that the user is prompted for a password when attempting to open the
file.

Kind Regards,

Terry




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Setting an Open-file password


Terry,

following opens a file,
if it doesnt have a password then saves it WITH the password
then closes it.

error handling (file should exist etc, pw cannot be zero lenght..
to be added.

Sub OpenAndSaveWithPW(strFullPath$, strPW$)
With Workbooks.Open(strFullPath, Password:=strPW)
If Not .HasPassword Then
Application.DisplayAlerts = False
.SaveAs .FullName, Password:=strPW
Application.DisplayAlerts = True
End If
.Close
End With
End Sub





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Terry wrote :

Hi Julie,

The excel file is created in an automated process from DTS within
MSSQL 2000.

Thanks,
Terry

"JulieD" wrote:

Hi Terry

no code needed, save the file using file save as ... choose tools
in the dialog box toolbar, general options - and you can then set a
password to open and /or a password to modify.


--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Terry" wrote in message
...
Hi All,

Can anyone assist me in the code I need to write to password
protect a file
so that the user is prompted for a password when attempting to
open the file.

Kind Regards,

Terry




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
Can not open the Password file vishu Excel Discussion (Misc queries) 0 March 24th 10 08:48 AM
open ftp file with password Kevin Excel Worksheet Functions 1 September 5th 07 05:02 PM
Setting a password on a Single File Web Page (mht; mhtml file) sinplicity Excel Discussion (Misc queries) 0 November 3rd 05 02:59 PM
Password to open file dcknie Excel Discussion (Misc queries) 3 June 29th 05 03:49 PM
Open file without Password Steph[_3_] Excel Programming 1 October 26th 04 08:53 AM


All times are GMT +1. The time now is 08:19 PM.

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"