I would like to show the xlDialogOptionsListsAdd dialog and retrieve the name or index of the custom list that was selected.
I can show the dialog easily using:
Application.Dialogs(xlDialogOptionsListsAdd).Show
but I'm guessing that if I want to know what value the user selected, then I have to pass a parameter to Show().
This page says that the parameter is a string_array for xlDialogOptionsListsAdd: https://msdn.microsoft.com/EN-US/library/office/ff838781.aspx
there isn't much information regarding what the parameter is for. Is it the list to initialize the dialog by selecting a list by default when it is shown? Or is it, as I am hoping, the output of the dialog with the list that the user selected (instead of a return value, pass the output variable as a parameter)?
either way, I can't seem to get the code to run when I pass a parameter.
I have tried:
Does anyone know how to get this working?
I can show the dialog easily using:
Application.Dialogs(xlDialogOptionsListsAdd).Show
but I'm guessing that if I want to know what value the user selected, then I have to pass a parameter to Show().
This page says that the parameter is a string_array for xlDialogOptionsListsAdd: https://msdn.microsoft.com/EN-US/library/office/ff838781.aspx
there isn't much information regarding what the parameter is for. Is it the list to initialize the dialog by selecting a list by default when it is shown? Or is it, as I am hoping, the output of the dialog with the list that the user selected (instead of a return value, pass the output variable as a parameter)?
either way, I can't seem to get the code to run when I pass a parameter.
I have tried:
Code:
Dim list as Variant
Dim list2() as String
Dim list3 as Variant
list3 = Application.GetCustomListContents(1)
Application.Dialogs(xlDialogOptionsListsAdd).Show list
'Application.Dialogs(xlDialogOptionsListsAdd).Show list2
'Application.Dialogs(xlDialogOptionsListsAdd).Show list3
Does anyone know how to get this working?