Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default sendmail works in excel 2002 but not 2000

Look at your win.ini file
See number 2 on this page
http://www.rondebruin.nl/mail/problems.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"RogueSwan" wrote in message om...
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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sendmail works in excel 2002 but not 2000

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 ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default sendmail works in excel 2002 but not 2000

Hi Rogue

Do you use Outlook or Outlook express



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Rogue Swan" wrote in message ...
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 ***



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Excel 2002 to MS Works T. Jenkins Excel Discussion (Misc queries) 4 November 8th 08 10:43 PM
Excel 2000 VBA App Now Works in Excel 2003, but not Excel 2002 bobkaku Excel Programming 0 March 11th 05 02:07 AM
Code works with Excel 2000 but not with Excel 2002 La Durande Excel Programming 0 September 17th 04 09:46 PM
Code works with Excel 2000 but not with Excel 2002 Tom Ogilvy Excel Programming 0 September 17th 04 09:21 PM
Code works with Excel 2000 but not with Excel 2002 La Durande Excel Programming 0 September 17th 04 08:49 PM


All times are GMT +1. The time now is 03:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"