View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MailHelp MailHelp is offline
external usenet poster
 
Posts: 1
Default Worksheet Mailing Conditions

I have the following code:

Sub Mail_ActiveAheet()
Dim strDate as String
ActiveSheet.Copy
strDate = Format(Date, "dd-mm-yy") & " " & _
Format(Time, "h-mm-ss")
ActiveWorkbook.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strDate & ".xls"
ActiveWorkbook.SendMail ", _
"Subject Line"
ActiveWorkbook.ChangeFileAccess xlReadOnly
Kill ActiveWorkBook.FullName
ActiveWorkbook.Close False
End Sub

....and I am using it to send a read receipt to my email
address when the Excel file has been opened. I have a
hidden worksheet that includes the current date and time
that the file was opened. This hidden sheet is what gets
sent to me. What I need to do is figure out how to get
Excel to set a variable that will be checked when the file
is opened more than once. I don't want to get an email
everytime it's opened, just the first time. Is this
possible? Thanks.