ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel contents to Outlook email (https://www.excelbanter.com/excel-programming/285063-excel-contents-outlook-email.html)

Mohan Manicks

Excel contents to Outlook email
 
Hi,

Is there a way to get the contents (few cell values) form
an Excel worksheet into a new outlook email throug VBA. I
don't want to attach the entire file.

Also, is there a way to get the file size (in KB) into
Excel sheet through VBA. I am already opening this text
file and copying the contents into the excel sheet through
VBA. I also want to get the file size.

Any help would be appreciated.

Thank you.

Dick Kusleika[_3_]

Excel contents to Outlook email
 
Mohan

For Outlook emails see these sites. If you can't find your answer there,
post back

www.dicks-clicks.com
www.rondebruin.nl

For file size, you can use the FileSystemObject. Set a reference to
Microsoft Scripting Runtime and you can get the size like this example

Sub test()

Dim fso As FileSystemObject
Dim FileSize As Double

Set fso = New FileSystemObject

FileSize = fso.GetFile("C:\Dick\CharityFormulas.txt").Size

MsgBox FileSize \ 1000

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Mohan Manicks" wrote in message
...
Hi,

Is there a way to get the contents (few cell values) form
an Excel worksheet into a new outlook email throug VBA. I
don't want to attach the entire file.

Also, is there a way to get the file size (in KB) into
Excel sheet through VBA. I am already opening this text
file and copying the contents into the excel sheet through
VBA. I also want to get the file size.

Any help would be appreciated.

Thank you.




Bill Manville

Excel contents to Outlook email
 
Mohan Manicks wrote:
I also want to get the file size.


Simplest way for file size is

FileSize = FileLen("C:\MyDir\Myfile.xls")

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup



All times are GMT +1. The time now is 03:13 PM.

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