Am using the code below to auto generate a toolbar with Excel, the Excel application is being passed into this code.

This works fine for Excel and Word, however will not work for the Outlook application - any help would be greatly appreciated.

NB: The object pobjExcelApp is being passed from a startup excel script.

Public Function InstallToolbarExcel(ByRef pobjExcelApp As Excel.Application) As Boolean

Dim lobjOpenExcelFromSPFButton As Object
Dim lobjSaveExcelToSPFButton As Object
Dim lobjCmdBar As CommandBar

InstallToolbarExcel = True

'*** If the command bar already exists then remove it
On Error Resume Next
On Error GoTo InstallToolbarExcel_ERROR

If InstallToolbarExcel = True Then

' set up the Excel toolbar
'*** Set up the command bar
Set lobjCmdBar = pobjExcelApp.CommandBars.Add(Name:=CUSTOM_TOOLBAR)
With lobjCmdBar
.Position = msoBarTop
.Visible = True
End With

Dim lobjPic As Object

' create the first button "Open From SPF" for Excel files
Set lobjOpenExcelFromSPFButton = lobjCmdBar.Controls.Add(Type:=msoControlButton)
With lobjOpenExcelFromSPFButton
.BeginGroup = True
.OnAction = "OpenExcelFromSPF_Click"
.Style = msoButtonIconAndCaption
' Worksheets("SPF Help").Pictures("Icon_AddMultiple").Copy
' .PasteFace
.ToolTipText = "Open Excel From SPF"
End With

' create the second button "Save To SPF" for Excel files
Set lobjSaveExcelToSPFButton = lobjCmdBar.Controls.Add(Type:=msoControlButton)
With lobjSaveExcelToSPFButton
.BeginGroup = True
.OnAction = "SaveExcelToSPF_Click"
.Style = msoButtonIconAndCaption
' Worksheets("SPF Help").Pictures("Icon_Delete").Copy
' .PasteFace
.ToolTipText = "Save Excel To SPF"
End With


' kill all objects
Set pobjExcelApp = Nothing

End If

Unload frmInstallToolbar

'close all applications
Exit Function

InstallToolbarExcel = False
GoTo InstallToolbarExcel_EXIT
End Function