Excel 2003

T

TOM

Hello,

I used these two "scripts" in Offic Xp and works perfectly. Now I am using
Office 2003 and these scripts dosnt work, so can you help me?

First: If outlook dosnt run then run outlook (it allways opens)

On Error Resume Next
WhichProgram = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then IsItRunning = True
Err.Clear
If IsItRunning = True Then
Dim RetVal
RetVal = Shell("C:\Program Files\Microsoft
Office\Office11\Outlook.EXE", 6)
End If

Second: Send email from excel (Outlook just flash but nothing happens)

Dim objEnv As MsoEnvelope
ActiveSheet.Range("A1", "D30").Select
ThisWorkbook.EnvelopeVisible = True
Set objEnv = List1.MailEnvelope
With objEnv
.Item.To = "(e-mail address removed)"
.Item.Subject = "Test"
.Item.Send
End With


Thank you Tom
 
J

Juan Pablo González

Use

CreateObject "Outlook.Application"

instead of the Shell command. Not sure if your install made into the same
path, which might be the cause of your problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top