Thread: Error message
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Michelle Michelle is offline
external usenet poster
 
Posts: 3
Default Error message

I wrote a macro in excel that allows users to e-mail the excel file as
an attachment. To do this I used the ActiveWorkbook.SendMail, along
with a UserForm so they can choose either to send the mail or to
cancel. Below is my code for the button that sends the e-mail:

Dim Subj
Subj = "" & ActiveWorkbook.Name & " New Prod. Req Approval"
ActiveWorkbook.SendMail ",
Subject:=Subj
Me.hide
MsgBox ("Your E-mail Has Been Sent")

The file sends fine, but the problem I am having is when you close the
file after sending the e-mail. When you close the file and it asks
you, do you want to save changes? If you choose NO, everything is
fine. But if you choose yes, you get an error message from Dr. Watson
for Windows NT. The message says: An application error has occurred
and an application error log is being generated.

EXCEL.exe
Exception: access violation (Oxc0000005), Address 0x6512be2d
Then three buttons OK, Cancel, Help

Does anyone have any ideas why I am getting this message? I cannot
figure it out.

Thanks,
Michelle