遇到错误462:远程服务器计算机不存在

时间:2017-05-11 12:27:54

标签: vba

这是我的代码。我有一个错误。这个错误没有引起所有的时间。有时出现错误并说远程服务器不存在。请帮我解决这个问题。

Private Sub CommandButton1_Click()
    Dim sItem As String
    Dim fldr As FileDialog

    sItem = ""
    Set fldr = Application.FileDialog(msoFileDialogFolderPicker)

    With fldr
        .Title = "Select"
        .InitialFileName = "C:\"
        If .Show = True Then
            sItem = .SelectedItems(1)
        Else
            MsgBox ("Select a Folder")
        End If
    End With
End Sub

0 个答案:

没有答案