File Size Matters

A

AndrewJ

Hello,

I'm not sure if this is an Outlook issue or an Excel one, but thought
best to start here. I'm using the following code to send an Excel
worksheet via Outlook. The issue I'm having is this...when I send the
e-mail it's about 99kb in size, but when the other users from my team
are sending it out, it can be as big as 546kb. We send this file out
every hour and it's filling up people's inbox. We're using the same
file and same macro to send it....I'm at a loss. Not sure what could
be causing it.

We are using Outlook 2003 and Excel 2003

Private Sub CommandButton1_Click()
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With

Set rng = Nothing
Set rng = ActiveSheet.UsedRange

Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.From = ""
.To = ""
.CC = ""
.BCC = ""
.Subject = Format(Date, "mm-dd-yy ") & "9PM "
.HTMLBody = RangetoHTML(rng)
.Display

End With
On Error GoTo 0

With Application
.EnableEvents = True
.ScreenUpdating = True
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub

If anyone has any ideas as to why this would happen I would appreciate
your thoughts.

Thanks,
Andrew
 
R

Ron de Bruin

Hi AndrewJ

Be sure that the usedrange is correct

Ctrl End will select the last cell
If it is to large the html is also large
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top