Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 11-27-2013, 07:52 AM
funkyfido funkyfido is offline Removing a password from a worksheet Windows XP Removing a password from a worksheet Office 2007
Novice
Removing a password from a worksheet
 
Join Date: Jun 2013
Posts: 24
funkyfido is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
I suspect your basic issue is that you have unqualified sheet & workbook references (plus you're code is telling Excel to open an xlsm file whereas the one you provided for testing is an xlsx file). Try:
Code:
Sub Test()
Dim xlWkBk As Workbook
Set xlWkBk = Workbooks.Open(Filename:="c:\My Documents\Try this.xlsx", _
  Password:="one", WriteResPassword:="two", AddToMRU:=False)
With xlWkBk
  .SaveAs Filename:="C:\My Documents\New\Try this 1.xlsm", _
    FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False, AddToMRU:=False
  .Sheets("Sheet1").Unprotect Password:="Test"
End With
End Sub
Note that there is no need for the ChDir code.
Superb! That has solved my issue. Thank you so much.
Reply With Quote
 

Tags
password, remove password



Similar Threads
Thread Thread Starter Forum Replies Last Post
Password protected file no longer offers password dialog on Open htaylor Word 0 10-15-2013 12:35 PM
Removing a password from a worksheet How to summarise different worksheet to a summary worksheet samkiewhock Excel 1 09-06-2012 03:34 AM
Removing a password from a worksheet Outlook requests password afeter changing windows password pask Outlook 5 03-16-2012 08:43 AM
Removing a password from a worksheet Removing password protection HantsDave Word VBA 9 03-08-2012 11:57 AM
Removing a password from a worksheet Trouble Removing Password cure4glass Word 1 02-17-2012 07:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:28 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft