Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can not open the Password file | Excel Discussion (Misc queries) | |||
open ftp file with password | Excel Worksheet Functions | |||
Remove or change password protected excel file | Excel Discussion (Misc queries) | |||
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. | Excel Worksheet Functions | |||
bypass password when update linking of password protected file | Excel Discussion (Misc queries) |