VBA代码中的问题不是Excel中的问题,因为当我将代码复制到另一个Excel工作时。
Private Sub CommandButton1_Click()
Dim MyFolder As FileDialog
Set MyFolder = Application.FileDialog(msoFileDialogFolderPicker)
MyFolder.AllowMultiSelect = False
MyFolder.Show
Sheet2.Range("K6") = MyFolder.SelectedItems(1)"\" TextBox1 = MyFolder.SelectedItems(1)&"\"
Set diaFolder = Nothing
End Sub