ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File Size Matters (https://www.excelbanter.com/excel-programming/409963-file-size-matters.html)

AndrewJ[_2_]

File Size Matters
 
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

ryguy7272

File Size Matters
 
Based only on a quick look, that code seems ok.
Have you had a look at this?
http://www.rondebruin.nl/sendmail.htm

Regards,
Ryan---

--
RyGuy


"AndrewJ" wrote:

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


Ron de Bruin

File Size Matters
 
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



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"AndrewJ" wrote in message ...
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



All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com