Results 1 to 2 of 2
Thread: Password protected links (2003)
2005-12-12, 18:18 #1
- Join Date
- Aug 2002
- milton keynes, Buckinghamshire
- Thanked 0 Times in 0 Posts
Password protected links (2003)
I need to copy all the cells of a worksheet from one workbook and paste these as values into another. I do not wish to delete either source or destination worksheets, as this would corrupt various formulas. Normally this copy and paste would be quite a straight forward exercise. However on this ocassion the source sheet contains links to a third, protected workbook. I am not permitted to break these links.
Each time I run the program it stops at this copy and paste point to ask the user for a password to the protected workbook.
I have tried application.Display alerts = false, however the box still appears.
Can somebody please advise how best to proceed
I set out below my current code for information.
Private Sub CopyManAcctsCodesExtension()
ThisWorkbook.Worksheets("Man Accts Code Extension Copy").Cells.Clear
Workbooks.Open strManagementAccountsLongFilename, 0
Application.DisplayAlerts = False
Worksheets("Code Extension").Range("A3:CZ65000").Copy ThisWorkbook.Worksheets("Man Accts Code Extension Copy").Range("A3:CZ65000")
Worksheets("Man Accts Code Extension Copy").Range("A3:CZ65000").Copy
Worksheets("Man Accts Code Extension Copy").Range("A3:CZ65000").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
Workbooks(strManagementAccountsShortFilename).Clos e savechanges:=False
Application.DisplayAlerts = True
2005-12-12, 18:39 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: Password protected links (2003)
I guess it is unavoidable - otherwise someone could get at the data in the protected workbook without providing the password.
You could try pasting the range as values in the source workbook first (you could create a new worksheet for this purpose), then copying these values to the other workbook. Since you close the source workbook without saving changes anyway, it won't harm. But I don't think it'll avoid the password prompt.