Leisuregroove
New Member
- Joined
- Jan 25, 2019
- Messages
- 5
Hi All,
I have another question.
I have some code to automatically enter a password (linked pw protected docs) in multiple times when using my update links macro. It works fine.
The issue I have is sometimes when I open the document it asks me to enable content which I then have to manually enter the password in multiple times.
Is there a way to automatically enable content and enter password when opening the document?
My password code Is this:
Sub UpDateLinks()
Const PWord As String = "0dear"
Dim xlLinks
Dim i As Integer
xlLinks = ThisWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(xlLinks) Then
For i = 1 To UBound(xlLinks)
SendKeys PWord & "{Enter}"
ThisWorkbook.UpdateLink Name:=xlLinks(i)
Next i
End If
End Sub
Can I incorporate this somehow when enabling content?
Hopefully someone can help.
Cheers,
LG
I have another question.
I have some code to automatically enter a password (linked pw protected docs) in multiple times when using my update links macro. It works fine.
The issue I have is sometimes when I open the document it asks me to enable content which I then have to manually enter the password in multiple times.
Is there a way to automatically enable content and enter password when opening the document?
My password code Is this:
Sub UpDateLinks()
Const PWord As String = "0dear"
Dim xlLinks
Dim i As Integer
xlLinks = ThisWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(xlLinks) Then
For i = 1 To UBound(xlLinks)
SendKeys PWord & "{Enter}"
ThisWorkbook.UpdateLink Name:=xlLinks(i)
Next i
End If
End Sub
Can I incorporate this somehow when enabling content?
Hopefully someone can help.
Cheers,
LG