J
Jaan
Hi
I am using code to log in our intranet
That works perfectly, but trouble is: I must insert my password manually.
How can I use vba to insert password automaticcaly.
I use code below
Sub TEST_UpDate()
Dim strFolderName As String
Dim Workbook As Workbooks
strFolderName = "Z:\Test"
On Error GoTo Err_Handler
Dim strFileName
With Application.FileSearch
..NewSearch
..LookIn = strFolderName
..Filename = ".CSV"
..SearchSubFolders = True
..Execute SortBy:=msoSortBySize
..LookIn = strFolderName
..Filename = ".CSV"
..SearchSubFolders = True
If .Execute(msoSortByLastModified, msoSortOrderDescending) > 0 Then
strFileName = .FoundFiles(1)
Application.Workbooks.Open strFileName
End If
End With
Exit_Sub:
Exit Sub
Err_Handler:
Resume Exit_Sub
End Sub
I am using code to log in our intranet
That works perfectly, but trouble is: I must insert my password manually.
How can I use vba to insert password automaticcaly.
I use code below
Sub TEST_UpDate()
Dim strFolderName As String
Dim Workbook As Workbooks
strFolderName = "Z:\Test"
On Error GoTo Err_Handler
Dim strFileName
With Application.FileSearch
..NewSearch
..LookIn = strFolderName
..Filename = ".CSV"
..SearchSubFolders = True
..Execute SortBy:=msoSortBySize
..LookIn = strFolderName
..Filename = ".CSV"
..SearchSubFolders = True
If .Execute(msoSortByLastModified, msoSortOrderDescending) > 0 Then
strFileName = .FoundFiles(1)
Application.Workbooks.Open strFileName
End If
End With
Exit_Sub:
Exit Sub
Err_Handler:
Resume Exit_Sub
End Sub