I have an approval database that upon final approval, launches an excel spreadsheet that it attached to the document. My users have an excel add-in that allows them to upload the contents of the spreadsheet into SAP. However, when EXCEL launches from Notes, the add-in menu does not appear. When EXCEL is launched from windows, the add-in does appear. Please help me determine what is missing from my code that prevents the display of the add- in menu.
Here is my code:
Sub OpenMPU
Dim uiw As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Set uidoc = uiw.CurrentDocument
Dim s As New NotesSession
Dim db As NotesDatabase
Set doc = s.DocumentContext
Set db = s.CurrentDatabase
Set xlDoc = uidoc.Document
'get the attachment’s file name
Set attachedFile = xlDoc.GetFirstItem("MPUUpload")
fileName = attachedFile.EmbeddedObjects(0).Name
'get handle on object
Set object = xlDoc.GetAttachment(fileName )
'location of temporay file
fileLoc = "c:\" & object.Name
'extract attachment to temp file location
Call object.ExtractFile(fileLoc)
'open the temp file with excel
Set xlApp = CreateObject("Excel.application")
Set xlBook = xlApp.WorkBooks.Open(fileLoc)
If xlBook Is Nothing Then
Set xlSheet = Nothing
Set xlNewWkbk = Nothing
Set xlWkbks = Nothing
Set xlApp =Nothing
Msgbox "Cannot locate MPU Upload file."
Exit Sub
End If
xlApp.Visible = True
End Sub