I have some vbs which is supposed to open a password protected file, copy a range from another file and then close and save the target file. I cannot see why it is not working. Can anyone spot it? The code works up until the point where it is supposed to open and modify the file. Thank you in advance.
strProtectedFile = "C:\srvr\rie-bin\CLIPr\Nav.xls"
strProtectedFilePassword = "1234"
Set oProtectedFile = xlApp.Workbooks.Open(strProtectedFile, strProtectedFilePassword, False)
oProtectedFile.Worksheets("Sheet1").Visible = True
oProtectedFile.Worksheets("Sheet1").Visible = False
xlApp.DisplayAlerts = False
xlApp.DisplayAlerts = True