Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Staus Bar - Size Matters | Excel Discussion (Misc queries) | |||
Printing matters | Excel Discussion (Misc queries) | |||
size matters : ) | Excel Discussion (Misc queries) | |||
Size Matters - minimizing file size | Excel Programming | |||
Matters in charts and pivottables | Charts and Charting in Excel |