Hi All,
I am getting "A Module is not a valid type" error while trying to run below code. This code works fine when it is in the same file where data is saved. But giving error when being run from Personal.xlsb workbook. Unable to understand it is happening.
Please help.
Thanks,
DJ
I am getting "A Module is not a valid type" error while trying to run below code. This code works fine when it is in the same file where data is saved. But giving error when being run from Personal.xlsb workbook. Unable to understand it is happening.
Code:
Function FilePath() As String
Dim FD As FileDialog
Set FD = Application.FileDialog(msoFileDialogFilePicker)
With FD
.AllowMultiSelect = False
.Filters.Clear
.ButtonName = "Select File"
.InitialFileName = ""
.Filters.Add "Excel Files", "*.csv,*.xlsm,*.xlsx,*.xlsb"
.InitialView = msoFileDialogViewList
.Title = "Please select a file"
.Show
End With
Please help.
Thanks,
DJ
Last edited by a moderator: