Greetings! Macro Question (Emailing).

Madakushka

New Member
Joined
Mar 31, 2012
Messages
1
Hello All!

I have been searching these forums and my friend Google for any indication as to why I am having the issue at hand (user error most likely).

I have created a Macro to email a range of cells to a mailing list of my choosing. However when I email said range, which includes grouped rows that are collapsed, the recipients do not receive the email with those grouped rows collapsed. For some reason the email defaults the expanded view of the grouped rows (which is upwards of 300 rows) and is rough to view on a smart phone/etc.

The Macro I am using is the quick and easy one supplied from Microsoft's website. Thanks for reading and for any ideas as I am new to this!

ActiveSheet.Range("A2:O109").Select

ActiveWorkbook.EnvelopeVisible = True

With ActiveSheet.MailEnvelope
.Introduction = ""
.Item.to = "EmailAddress"
.Item.Subject = "Subject" & Time
.Item.Display
End With
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,358
This unhides all the collapsed rows before emailing.

Code:
    ActiveSheet.Range("A2:O109").Select
    [COLOR="Red"]Selection.EntireRow.Hidden = False[/COLOR]
    
    ActiveWorkbook.EnvelopeVisible = True
    
    With ActiveSheet.MailEnvelope
    .Introduction = ""
    .Item.to = "EmailAddress"
    .Item.Subject = "Subject" & Time
    .Item.Display
    End With
 

Watch MrExcel Video

Forum statistics

Threads
1,118,120
Messages
5,570,295
Members
412,318
Latest member
angoeyuan
Top