callimaco008
04-30-2008, 05:00 AM
Hi all;
my problem is the following:
I'm using an Excel document with a macro which send automatically an e-mail message when an action is preformed.
The code of the macro is:
Set objOutlook = GetObject(, "Outlook.Application")
On Error GoTo 0
If objOutlook Is Nothing Then
'Outlook isn't already running - create a new instance...
Set objOutlook = CreateObject("Outlook.Application")
blnNewInstance = True
'We need to instantiate the Visual Basic environment... (messy)
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objExplorer = objOutlook.Explorers.Add(objNameSpace.Folders(1), 0)
objExplorer.CommandBars.FindControl(, 1695).Execute
objExplorer.Close
Set objNameSpace = Nothing
Set objExplorer = Nothing
End If
blnSuccessful = objOutlook.FnSendMailSafe(sTo, sCC, sBCC, sSubject, sBody, sAttachment)
When the macro is executed an error is generated. The error says that FnSendMailSafe is not a function supported by objOutlook.
I can't modify the code...I nedd only to now if I miss some libraries or modules in my Excel.
Any idea?
Thanks to all will help.
my problem is the following:
I'm using an Excel document with a macro which send automatically an e-mail message when an action is preformed.
The code of the macro is:
Set objOutlook = GetObject(, "Outlook.Application")
On Error GoTo 0
If objOutlook Is Nothing Then
'Outlook isn't already running - create a new instance...
Set objOutlook = CreateObject("Outlook.Application")
blnNewInstance = True
'We need to instantiate the Visual Basic environment... (messy)
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objExplorer = objOutlook.Explorers.Add(objNameSpace.Folders(1), 0)
objExplorer.CommandBars.FindControl(, 1695).Execute
objExplorer.Close
Set objNameSpace = Nothing
Set objExplorer = Nothing
End If
blnSuccessful = objOutlook.FnSendMailSafe(sTo, sCC, sBCC, sSubject, sBody, sAttachment)
When the macro is executed an error is generated. The error says that FnSendMailSafe is not a function supported by objOutlook.
I can't modify the code...I nedd only to now if I miss some libraries or modules in my Excel.
Any idea?
Thanks to all will help.