sendmail works in excel 2002 but not 2000

R

RogueSwan

Hi there,

Here is my problem:

I have a workbook to email. If there is no email address in G8 then
call one macro which sends two emails. If there is an address call the
other macro which sends three macros.

Sub send_po()

If Range("G8").Value = "none supplied" Then
Call return_to_orderer
Else
Call send_to_supplier
End If
End Sub

This macro works on both Excel 2000 and 2002

Sub return_to_orderer()

Dim orderer As String
Dim wb As Workbook
orderer = Range("c4").Value

Set wb = ActiveWorkbook
With wb

.SendMail "(e-mail address removed)", "P.O. Number: " &
ActiveSheet.Range("C6")
.SendMail ActiveSheet.Range("g4"), "Please send this
to supplier as no email address is listed"
.ChangeFileAccess xlReadOnly
'Kill .FullName

End With

End Sub

This part works on Excel 2002 but causes an error on Excel 2000.
The error message is "Run-time error 2147417848 (80010108) Automation
error The object invoked has disconnected from its client"

Sub send_to_supplier()

Dim orderer As String

orderer = Range("c4").Value
Dim wb As Workbook
Set wb = ActiveWorkbook
With wb
.SendMail "(e-mail address removed)", "P.O. Number: " &
ActiveSheet.Range("C6")

.SendMail ActiveSheet.Range("g4"), "P.O. " &
ActiveSheet.Range("C6") & " has been approved and sent to " &
ActiveSheet.Range("C8")

.SendMail ActiveSheet.Range("G8"), "Purchase Order
Confirmation "
.ChangeFileAccess xlReadOnly
'Kill .FullName

End With
End Sub

Any clues as to why this works on my machine (Excel 2002) but not my
bosses (Excel 2000). I have tried declaring the ranges "G4" and "G8"
(as strings, variants and arrays) and then using those declarations in
the .SendMail line subsequent to this coding but nothing seems to have
worked.
Thanks in advance.
 
R

Rogue Swan

that is a solution for xl2002 which is not the problem (the mapix line
is on both machines).

I should have also mentioned that the error occurs here (after sending
the explicitly named email, which actually gets sent):

.SendMail ActiveSheet.Range("g4"), "P.O. " &
ActiveSheet.Range("C6") & " has been approved and sent
to " &
ActiveSheet.Range("C8")

.SendMail ActiveSheet.Range("G8"), "Purchase Order
Confirmation "
.ChangeFileAccess xlReadOnly
'Kill .FullName

End With
End Sub

*** Sent via Developersdex http://www.developersdex.com ***
 

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