• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

A Module is not a valid type error

DJ

Member
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.
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:
Back
Top