Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default PASSWORD REMOVAL I have the password to open the file and the password to modify the file now how to remove them

I have the password to open the file and the password to modify the
file and I have the file open in my code, NOW how do I remove the
passwords or set to an empty string value so I don't have to enter a
password when I open this file manually?

Dim ExcelApp As Excel.Application
Dim ExcelWB As Excel.Workbook
Dim hasPassword As Boolean
Dim ExcelSheet As Excel.Worksheet
Dim savePassword As String
Dim newPassword As String = ""
Dim wrbk As _Workbook
wrbk.Password = newPassword

savePassword = "LARRY"





ExcelApp = New Excel.Application
ExcelApp.DisplayAlerts = False
ExcelWB = ExcelApp.Workbooks.Open("MyFilePath" Type.Missing,
Type.Missing, Type.Missing, savePassword, modifyPassword, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing)
ExcelWB.Application.Visible = True
ExcelApp.DisplayAlerts = True

HERE I WANT TO ADD CODE TO REMOVE THE PASSWORDS I SUPPLIED TO THE
OPEN() method from the XLS workbook it opened.( Programmatically) OR
set them to an empty STRING value. Whatever it takes to where I don't
have to enter any passwords when I open it manually. Any idea how to do
this?? sincerest gratitudes



ExcelWB.Save()
ExcelWB.Close()
ExcelWB = Nothing
ExcelApp.Quit()
ExcelApp = Nothing

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
Remove or change password protected excel file Odawg Excel Discussion (Misc queries) 2 October 26th 05 03:54 AM
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. Daniel Excel Worksheet Functions 0 June 23rd 05 11:56 PM
bypass password when update linking of password protected file Yan Excel Discussion (Misc queries) 1 February 7th 05 11:29 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"