Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Staus Bar - Size Matters Teddy-B Excel Discussion (Misc queries) 2 March 25th 10 04:19 PM
Printing matters vito Excel Discussion (Misc queries) 10 August 25th 09 11:00 PM
size matters : ) tatty Excel Discussion (Misc queries) 2 July 23rd 07 05:07 PM
Size Matters - minimizing file size [email protected] Excel Programming 1 April 23rd 07 04:26 PM
Matters in charts and pivottables Juan Pablo Garcia Coello Charts and Charting in Excel 0 July 14th 06 10:55 AM


All times are GMT +1. The time now is 04:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"