Objective: use fFile variable, using FileDialog propert,y to extract column E in sheet 1 to another workbook.
Sub CopyColumnToWorkbook()
Dim sourceColumn As Range, targetColumn As Range, sFile As String
With Application.FileDialog(msoFileDialogFilePicker)
.ButtonName = "File path"
If .Show = -1 Then 'if ok is pressed
sFile = .SelectedItems(1)
End If
End With
Set sourceColumn = Workbooks(sFile).Sheets(1).Range("E3:E10000") 'Debugger points to this line
Set targetColumn = Workbooks("Target.xlsm").Worksheets(1).Columns("A")
sourceColumn.Copy Destination:=targetColumn
End Sub
Note: changed file to workbook, but still failed.
Bookmarks