Excel and Outlook

Y

Yannis

Hi,

I had a VBA macro within Excel that used to work (included below):
This VBA sub, would just email me the active workbook from Excel.

However, my company now has included some sort of increased protection in
Outlook and
when I run the macro now, I get a message that a third party program is
trying to send an email
through Outlook and it needs confirmation to send the email.

Does anyone know of a workaround for this?
I would like to email myself an excel file at regular intervals...


Thanks in Advance!


----------------------------------------------------------------------------
------------------------------
Sub eMail_file(strMail As String, strSubject As String, strBody As String)
'This example sends the last saved version of the Activeworkbook
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = strMail
.CC = ""
.BCC = ""
.Subject = strSubject
.Body = strBody
'.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add (strFname)
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub

----------------------------------------------------------------------------
 
Y

Yannis

Thanks Steve,
although it worked at my computer at home, it didn't work at the computer at
work...I guess outlook is too restricted there, so I need to find another
way (I am thinking of VNC now).

Yannis
 
P

Peo Sjoblom

Did you put the server name instead of the SMTP for work, I finished
something last week based on Ron's CDO and it worked
nice from work as well. The reason I am asking is that if you use the CDO
you won't even use Outlook at all. You can't use Win9 and ME though

--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
Y

Yannis

Yes I did put the server name and I got an error regarding authentication
from the server.
I found the server name from within outlook. Is there a different way to
find it? Remember I am
a user with no privileges at all (can't even run a .exe from my own drive!)
 
P

Peo Sjoblom

That is likely the problem, I have no restrictions so it works for me.
If this is for your regular work you might want to talk to your manager
about getting more privileges


--
Regards,

Peo Sjoblom

(No private emails please, for everyone's
benefit keep the discussion in the newsgroup/forum)
 
Top