In excel, I have used the following code successfully as part of an Excel macro and form, to pre-popluate a form drop down combo box with the open excel workbooks, to allow the use to select which workbook.

Private Sub UserForm_Initialize()
Dim SOmething As Excel.Application


Dim wkb As Workbook



With Me.ComboBox1
For Each wkb In Application.Workbooks
.AddItem wkb.Name
Next wkb
End With

LoadFrm
End Sub

Using the above code, does not seem to work in Outlook 2013. Returns an error object not set?


I suspect its to do with the different methods, vba works within outlook rather than excel. Objective here, is to pre-populate an outlook form, with current open excel workbooks, allow the user to select the workbook to use, then use that selection, as variable without outlook, to export attributes of emails to the excel workbook selected.

I have the rest of the code: just need the form selection of excel workbook to work.

Any ideas?

thanks