Filepicker VBA to select file and store the file name not working
问题 I am trying to run the following in order to get the file name that the user selects. The file is an .mdf file that is attached previously to an SQL server. But when I run it, a window comes out and says I don't have permission to open the file. I know it is because it is being used in SQL, because if I don't attach it in the SQL server it runs without a problem. The thing is that I need the mdf in SQL before running the vba code and I just need the file name. Is there a way to store the file