Paul_Hossler
09-08-2017, 11:24 AM
I have a OL macro that opens and reads a CSV, but I want to replace the hard-coded path with a dialog box that allows the user ( = Me) to pick a file and return the path to the macro
Apparently there is no inherent OL VBA capability like Excel's GetOpenFileName
I found some snippets via Google, but they don't seem to work, at least not with 2016
Does anyone have OL macros that allow the user to pick a folder and a file?
Thanks
Edit:
The typical approach uses this technique
http://www.robvanderwoude.com/vbstech_ui_fileopen.php
but the Set objDialog line throws error 429, ActiveX component can't create object
' Dependencies:
' Requires NUSRMGRLib (nusrmgr.cpl), available in Windows XP and later.
' To use the default "My Documents" WScript.Shell is used, which isn't
' available in HTAs.
'
' Written by Rob van der Woude
' http://www.robvanderwoude.com
' Standard housekeeping
Dim objDialog
' Create a dialog object
Set objDialog = CreateObject("UserAccounts.CommonDialog")
I'm assuming that it has something to do with NUSRMGRLib
Apparently there is no inherent OL VBA capability like Excel's GetOpenFileName
I found some snippets via Google, but they don't seem to work, at least not with 2016
Does anyone have OL macros that allow the user to pick a folder and a file?
Thanks
Edit:
The typical approach uses this technique
http://www.robvanderwoude.com/vbstech_ui_fileopen.php
but the Set objDialog line throws error 429, ActiveX component can't create object
' Dependencies:
' Requires NUSRMGRLib (nusrmgr.cpl), available in Windows XP and later.
' To use the default "My Documents" WScript.Shell is used, which isn't
' available in HTAs.
'
' Written by Rob van der Woude
' http://www.robvanderwoude.com
' Standard housekeeping
Dim objDialog
' Create a dialog object
Set objDialog = CreateObject("UserAccounts.CommonDialog")
I'm assuming that it has something to do with NUSRMGRLib