I am trying to save a file path in a variable using .SelectedItems but the code is showing "Runtime Error 450". Kindly help me by rectifying the mistake in the code. Thanks in Advance :)
Sub pickafile()
Dim x As FileDialog
Dim y As Variant
Set x = Application.FileDialog(msoFileDialogFilePicker)