I have a script that opens another workbook. This workbook is read-only and password protected. Is there a way to disable this? Here is what I have tried in the script:
ChDir "\\esp1\company\customer service\sun hua test"
Set fs = CreateObject("Scripting.FileSystemObject"
Set f = fs.GetFile(fs.GetFileName("sun hua master quote.xls")
If f.Attributes = 33 Then
f.Attributes = 0
End If
Workbooks.Open Filename:=f
The if statement line, I have tried ReadOnly and 1 (that is what the VBA help lists as readonly.) I put 33 in there because that is what the watch said is the value. I am assuming that it is 33 because 1 is for readonly plus 32 for archive. Am I on the right track? Thanks!
ChDir "\\esp1\company\customer service\sun hua test"
Set fs = CreateObject("Scripting.FileSystemObject"
Set f = fs.GetFile(fs.GetFileName("sun hua master quote.xls")
If f.Attributes = 33 Then
f.Attributes = 0
End If
Workbooks.Open Filename:=f
The if statement line, I have tried ReadOnly and 1 (that is what the VBA help lists as readonly.) I put 33 in there because that is what the watch said is the value. I am assuming that it is 33 because 1 is for readonly plus 32 for archive. Am I on the right track? Thanks!