I'm having the exact same problem. Most minecraft modpacks give me huge lagspikes and i want to put optifine in them but when i try to use the Open Folder button it says Access Denied. I've tried running as administrator but that does not work. I've also tried manually finding the curseforge folder on my computer but it's invisible or something.
I've figured out a way to fix it. Instead of downloading curseforge by itself you should download it's parent app called Overwolf, in that app you can download curse forge and for some reason that allowed me to change modpacks. Be warned it wont have your minecraft save files and because you cant access the files in the first curseforge i dont think you can transfer over your savefiles, you would have to start fresh.
For anyone still looking for an answer, in the modpack screen click the three dots, then 'Profile Options' and then check 'Allow content management for this profile' which allows you to modify your version of the modpack. Also this was only tried on the overwolf verion of curseforge.