PDA

View Full Version : Solved: Call Folder Picker from Cell



xluser2007
12-06-2008, 09:48 PM
Hi All,

Based on Ken Puls' superb KB entry (http://www.vbaexpress.com/kb/getarticle.php?kb_id=284) for picking a folder via a Userform, I would like to call this from a named range called "folder_picker".

I have the sample attached workbook, and am not sure why the event driven code to call the routine, when the user double-clicks "folder_picker" is not working.

Could any please explain how to make the above code work.

regards,

GTO
12-06-2008, 10:47 PM
Hey xlUser,
I think you mis-named the event. For:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
substitute:
Private Sub Worksheet_DoubleClick(ByVal Target As Range, Cancel As Boolean)

Hope this helps,

Mark

Edit: or better yet, do just backwards of what I said...

xluser2007
12-06-2008, 11:02 PM
Hey xlUser,
I think you mis-named the event. For:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) substitute:
Private Sub Worksheet_DoubleClick(ByVal Target As Range, Cancel As Boolean)
Hope this helps,

Mark

Edit: or better yet, do just backwards of what I said...
Thanks Mark, good pickup - works a treat now.

I realised that there is a drop down in the VBE for Event Driven Code, which would prevent such errors from popping up.

regards,