Link to home
Start Free TrialLog in
Avatar of MrDavidThorn
MrDavidThorn

asked on

VBA common dialog box to search for Excel file

Hi Experts

Been a while since I used the common dialog box and Iv fogot the commands avaiable.
I want a open  file box to pop up and allow the user to search for Excel files (post and pre 2007), I also want the dialog box to open in the my documents folder, I have the code below  - its opening the file open box but not applying the filter (I can see all other files) and its defaulting to a templates location on the c drive


Me.cdExcelFile.DialogTitle = "Select new source file"

Me.cdExcelFile.Flags = cdlOFNFileMustExist
Me.cdExcelFile.Filter = "Microsoft Excel Workbooks (*.xls;*.xlsx;*.xlsm)*.xls;*.xlsx;*.xlsm"

Me.cdExcelFile.ShowOpen
ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial