Thread
:
Subscript out of Range Q
View Single Post
#
2
Posted to microsoft.public.excel.programming
Nick Hodge
external usenet poster
Posts: 1,173
Subscript out of Range Q
John
My guess is you don't have a sheet called home. Even if you had nothing in
the cells the array will still fill with empty elements
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS
"John" wrote in message
...
I have the folloing coding trying to e-mail to addresses in AA6 & AB6 but
I'm getting a 'Sunscript out of Range' debug message. It says the MyArr is
empty yet its not I have e-mail addresses in both AA6 and AB6
My code is as follows, any help appreciated
Sub Mail_Reports()
Dim wb As Workbook
Dim strdate As String
Dim MyArr As Variant
strdate = Format(Now, "dd-mm-yy h.mm")
Application.ScreenUpdating = False
Sheets("E-Mys Shop").Visible = True
Sheets("E-Mys Shop").Copy
Set wb = ActiveWorkbook
With wb
.SaveAs ThisWorkbook.Name _
& " Sent on" & " " & strdate & ""
MyArr = Sheets("Home").Range("AA6:AB6")
.SendMail MyArr, Sheets("Home").Range("X15").Value
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
Sheets("E-Mys Shop").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Home").Select
Range("A1").Select
End Sub
Reply With Quote
Nick Hodge
View Public Profile
Find all posts by Nick Hodge