View Single Post
 
Old 03-24-2015, 07:57 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The macro should only leave Excel open if it was open before running the process.
The subscript out of range error suggests that VBA has crashed irrecoverably (in which case you need to reboot) or the criteria set at the top of the macro to match your data i.e.

Code:
Const strWorkBook As String = "Count0To12Hr.xls"        'The name of the attached workbook
Const strSheet As String = "Count0To12Hr"        'The name of the worksheet to process
Const strCell As String = "E2"        'The cell to process
Const iCount As Integer = 19        'The threshold value of the above cell
Const strMessage As String = "This is the reply message body text." 'The default signature will be included.
What is the range of values that could appear in E2?
What is the range of values that you might put in iCount?
Look up the numeric ranges for Integer and Long variables.

It might be better to change

Const iCount As Integer = 19
to
Const iCount As Long = 19
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote