+ Reply to Thread
Results 1 to 4 of 4

Error 6 Overflow

Hybrid View

tekapo Error 6 Overflow 10-03-2010, 01:13 AM
pike Re: Error 6 Overflow 10-03-2010, 01:28 AM
Leith Ross Re: Error 6 Overflow 10-03-2010, 01:30 AM
DonkeyOte Re: Error 6 Overflow 10-03-2010, 05:07 AM
  1. #1
    Registered User
    Join Date
    09-30-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    2

    Error 6 Overflow

    I have developed a tracking register for complaints and had it working well with automated email function, I modified to to include another reminder and now I keep getting an error 6 overflow.

    Can someone please provide advice?
    Attached Files Attached Files

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Error 6 Overflow

    Hi tekapo
    You dont have a sheet called "Complaints Register - DS"
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Error 6 Overflow

    Hello tekapo,

    Welcome to the Forum!

    You keep recreating the Outlook Application. You only need to create the Outlook Application at the very beginning of the code.
    Private Sub SendReminderButton_Click()
    Dim OutlookApp As Object
    Dim RowNo As Integer
    RowNo = 4
    Set OutlookApp = CreateObject("Outlook.Application")
    Do Until Worksheets("SWR DS Complaints Register").Cells(RowNo, 1).Value = "" + Worksheets("SWR DS Complaints Register").Cells(RowNo, 2).Value = ""
        If Worksheets("SWR DS Complaints Register").Cells(RowNo, 13).Value = "Overdue" Then
    
            With OutlookApp.CreateItem(olMailItem)
              .Subject = "OVERDUE COMPLAINT: " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 1).Value + Worksheets("SWR DS Complaints Register").Cells(RowNo, 2).Value
              .Body = "Regional Records indicate that the following Complaint from: " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 4).Value & " regarding " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 8).Value & " is currently overdue. Please action accordingly and provide the Regional Coordinatation Team with an update as soon as possible."
              .To = Worksheets("SWR DS Complaints Register").Cells(RowNo, 16).Value
              .Send
            End With
        Else
          If Worksheets("SWR DS Complaints Register").Cells(RowNo, 13).Value = "On Schedule" Then
     
            With OutlookApp.CreateItem(olMailItem)
              .Subject = " OUTSTANDING COMPLAINT: " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 1).Value + Worksheets("SWR DS Complaints Register").Cells(RowNo, 2).Value
              .Body = "Regional Records indicate that the following Complaint from: " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 4).Value & " regarding " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 8).Value & " has not been completed. Please action accordingly and provide the Regional Coordinatation Team with an update as soon as possible."
              .To = Worksheets("SWR DS Complaints Register").Cells(RowNo, 16).Value
              .Send
            End With
        Else
            If Worksheets("SWR DS Complaints Register").Cells(RowNo, 13).Value = "Recommendations" Then
    
            With OutlookApp.CreateItem(olMailItem)
              .Subject = " OUTSTANDING RECOMMENDATIONS OF COMPLAINT: " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 1).Value + Worksheets("SWR DS Complaints Register").Cells(RowNo, 2).Value
              .Body = "Regional Records indicate that the required recommendations of the Complaint from: " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 4).Value & " regarding " & Worksheets("SWR DS Complaints Register").Cells(RowNo, 8).Value & " have not been completed. Please action accordingly and provide the Regional Coordinatation Team with an update on the recommended improvement actions as soon as possible."
              .To = Worksheets("SWR DS Complaints Register").Cells(RowNo, 16).Value
              .Send
            End With
             End If
             End If
        End If
      RowNo = RowNo + 1
    Loop
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Error 6 Overflow

    Another point regards Overflow errors in general...

    When storing Row numbers in Variables it is always advisable to use a Long Type variable given Row boundaries exceed those of the Integer type.

    In VBA there's a general consensus that the Integer type is of very limited use given all Integers are in fact converted to Longs (and subsequently back to Integer) behind the scenes.
    On that basis most would say - just use Longs
    (or Byte if you know the value is going to be within Byte boundaries)

    Integer is useful if you want to deliberately generate an Overflow Debug but I would say that's an unlikely scenario (given you can just sanity check the value of the Long)
    Last edited by DonkeyOte; 10-03-2010 at 06:30 AM. Reason: reworded

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1