View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
RogueSwan RogueSwan is offline
external usenet poster
 
Posts: 2
Default sendmail works in excel 2002 but not 2000

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 ", "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 ", "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.