Advertisement

03.24.2004 at 01:01AM PST, ID: 20929997
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Unprotect Excel password in new SAVE AS file
Tags: excel, unprotect, password
Hi,

I would like to know what should I do in order to save an Excel work sheet (Password Protected) to an Excel unprotected work sheet.

For example:

Excel file A is protected by password '1234'

User open this file A then SAVE AS Excel file B.

By default, Excel file B will have the same '1234' password. but what i need to do here is:

Excel file A is remain protected but Excel file B is password free. Finally user do not know what is the password for Excel file A. Yet they can do modification on Excel file B.

Does it sound confusing? Thanks anyway!  

Regards,
Mashmallow

Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: mashmallow
Solution Provided By: sk009
Participating Experts: 4
Solution Grade: A
Views: 889
Translate:
Loading Advertisement...
03.24.2004 at 02:40AM PST, ID: 10666004

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2004 at 02:49AM PST, ID: 10666103

Rank: Guru

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2004 at 03:06AM PST, ID: 10666302

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2004 at 06:07AM PST, ID: 10667754

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2004 at 07:03AM PST, ID: 10668339

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2004 at 07:10AM PST, ID: 10668405

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.24.2004 at 07:23AM PST, ID: 10668536

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.25.2004 at 07:08AM PST, ID: 10677641

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.24.2004 at 02:40AM PST, ID: 10666004
Hello Mashmallow,
Use,

ActiveWorkbook.SaveAs Filename:="Book", password:=""

insted of ActiveWorkbook you can use,
Workbooks("WorkbookName").SaveAs Filename:="Book", password:=""

In general (with out macro)

Goto File > Save As > Press Tool Button > Make the password field blank and save the file.

Tapan.
 
03.24.2004 at 02:49AM PST, ID: 10666103

Rank: Guru

Hi Mashmallow,

How does the user open the file without the password? Through a VBA script?

Anyway, you may wish to look into the WorkbookBeforeSave event. For example:

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, _
        ByVal SaveAsUI As Boolean, Cancel as Boolean)

'Not sure I'm on the right path here. Anyway, try this, change the filename as need be

    ActiveWorkbook.SaveAs Filename:="C:\Excel Files\B.xls", FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False

End Sub

Regards,
Justin
 
03.24.2004 at 03:06AM PST, ID: 10666302
Hello Tapan and Justin,

Thanks for your valuable comment. There are 2 way of password protected in Excel.

First method:
File > Save As > Press Tool Button  > General > Key in password.

2nd method:
Tool > Protection > Protect Sheet

My way of protect the Excel file is using 2nd method, therefore the user able to read the Excel file.

What I need to do here is user still able to read the file, but can't make any change on it. If user need to modify the file, that must be done in his/her own copy.

Let consider this event happen:
When user choose to save as the file, the dialog box xlDialogBoxSaveAs pop out, with Save and Cancal button.

I need to know, how to get the return from the event click Save and click Cancel.

What I need to do:
Click Save: save the file and unprotect the new save file.
Click Cancel: Do nothing.

Thanks again!


 
03.24.2004 at 06:07AM PST, ID: 10667754
Dear Mashmallow,

In order to get the return from xlDialogBoxSaveAs, you need to trigger the event from the code not from user click 'Save As'. So the right time to trigger it when user want to close/exit the workbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim dlgAnswer As String
dlgAnswer = Application.Dialogs(xlDialogSaveAs).Show
If dlgAnswer = "True" Then 'Return True for Save, False for cancel
    'Put the code to unprotect the new saved file
Else
    'Do nothing
End If
End Sub

Hope it will help you LSF s.a.m

AlaGogo

Assisted Solution
 
03.24.2004 at 07:03AM PST, ID: 10668339
Mashmallow

Copy and paste the code below in "This workbook" section of VB
(remember to change the sheet name to the actual name of the proected worksheet and the unprotect password to the actual password used by you to protect the sheet. Also, change the path name to the desired location and the "ABC" represents the file name to be given to the new workbook.

Sub Workbook_BeforeClose(Cancel As Boolean)
 dosave = MsgBox("Do you wish to save the current workbook?", vbYesNoCancel, "Unsaved workbook")
  Application.DisplayAlerts = False
  Application.ScreenUpdating = False
 If dosave = 6 Then
   ActiveWorkbook.Save
   Sheets("Sheet1").Unprotect Password:="abc"
Restart:
    SaveAsName = "H:\Macro Testing\" & "ABC"
    On Error GoTo Restart
    ActiveWorkbook.SaveAs Filename:=SaveAsName, FileFormat:= _
        xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
        , CreateBackup:=False
   DontSaveIt = False
  ElseIf dosave = 2 Then
   Cancel = True
   Exit Sub
  Else
   DontSaveIt = True
 End If
 If DontSaveIt = False Then
  ActiveWorkbook.Save
 Else
  ActiveWorkbook.Saved = True
 End If
End Sub

hope this helps
SK
Accepted Solution
 
03.24.2004 at 07:10AM PST, ID: 10668405
Mashmallow:

Forgot to mention that the path to be given in the SaveAsName should be an existing one. e.g. if you are giveing the path as "C:\XYZ", the XYZ directory should be present.

SK
 
03.24.2004 at 07:23AM PST, ID: 10668536
Another comment:

It would be a good idea to password protect the code from viewing. Otherwise, one can always go in the VB editor and see what the password for sheet protection is (in the give code - it is abc).

SK
P.S. Maybe 50 points are a bit low for this. (hahaha)
 
03.25.2004 at 07:08AM PST, ID: 10677641
Hello Mashmallow,

Thanks for the points and the grade. Hope the code worked fine for you.

SK
 
 
20080236-EE-VQP-29