Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2000 File with VBA Problems in Excel 2003

Status
Not open for further replies.

Fiat77

Programmer
Feb 4, 2005
63
0
0
US
We have the below code that runs on the button click. In excel 2000 the code runs fine and opens the Outlook Application to a new email and inserts the defined subject into the subject line and the send to information. We have a user that is using Excel 2003 and the code is breaking at the line in between the asterisks. The problem being, that Outlook is not opening so therefore the rest of the code can not be completed. We've checked the Macro security in Outlook 2003 and it is set to Medium. The error message we are getting is as follow:

Error Message:

General Mail Failure: Quit Microsoft Excel, restart the Mail system and try again.

We have tried existing out of Excel and Outlook and restarting but we continue to get the same error message.

Can someone help us out. We've never see this error message before.
Thanks,

Private Sub CommandButton1_Click()

Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you want to E-Mail this document to FF Audit?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
Title = "Warning" ' Define title.
Help = "DEMO.HLP" ' Define Help file.
Ctxt = 1000 ' Define topic
' context.
' Display message.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
'On Error GoTo err_showSendDialog
If Response = vbYes Then
' User chose Yes.
Dim ws As Worksheet, myrange As Range, c As Range, myStr As String
Dim X(), i As Long
Set ws = ThisWorkbook.Sheets("Level 2 Support Manager")
Set myrange = Range("B37,B38,B39,B40")
X = Array(" FP Usage Reviewed---", " FP Usage Approved---", " Completed By Level 2 Support Manager---", " Contract Governance Recipient---")
For Each c In myrange

If c = "" Then myStr = myStr & X(i)
i = i + 1
Next
If Len(myStr) > 0 Then
MsgBox "You missed " & vbNewLine & myStr, vbCritical
Else
If Sheets("Level 2 Support Team Member").Range("b34").Value > #1/1/2001# Then
Sheets("Level 2 Support Manager").Unprotect
Sheets("Level 2 Support Manager").Range("b22").Value = Now()
Sheets("Level 2 Support Manager").Protect

************************************************************
Application.Dialogs(xlDialogSendMail).Show "FFAudit@gaic.com",

*********************************************
ActiveSheet.Range("d9").Value
ActiveSheet.Protect DrawingObjects:=False, Contents:=False, Scenarios:=False

Sheets("CaptureProfile").Visible = True
Application.Run ("Copy_Profile")
Sheets("CaptureProfile").Visible = False
Sheets("Level 2 Support Manager").Select
Me.CommandButton3.Enabled = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

End If
End If
Else ' User chose No.
DoCmd.CancelEvent

exit_showSendDialog:
Exit Sub


'Application.Dialogs(xlDialogSendMail).Show "FFAudit@gaic.com", ActiveSheet.Range("d9").Value
End If
End Sub
 
I would advise you post this problem in Forum 707 dedicated to VBA
Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top