canucklady
04-26-2007, 01:23 PM
Hello everyone,
This seems like an easy enough question, but can't seem get my code to work.
I am trying to open a workbook, which is has a link to workbook which is password protected. With the code I have the it still asks me for password, any ideas?
Sub OpenWB()
Workbooks.Open Filename:= _
"c:\workbook1.xls" _
, UpdateLinks:=3
ActiveWorkbook.UpdateLink Name:= _
"c:\workbook2.xls" _
, Type:=xlExcelLinks, Password:="password"
ActiveWorkbook.Save
ActiveWindow.Close
End Sub
This seems like an easy enough question, but can't seem get my code to work.
I am trying to open a workbook, which is has a link to workbook which is password protected. With the code I have the it still asks me for password, any ideas?
Sub OpenWB()
Workbooks.Open Filename:= _
"c:\workbook1.xls" _
, UpdateLinks:=3
ActiveWorkbook.UpdateLink Name:= _
"c:\workbook2.xls" _
, Type:=xlExcelLinks, Password:="password"
ActiveWorkbook.Save
ActiveWindow.Close
End Sub