View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Saving a worksheet with links

A copy/Paste example <g

Sub Mail_OneSheet_Outlook()
'You must add a reference to the Microsoft outlook Library
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
Sheets("OCC").Copy
Cells.Copy
Cells.PasteSpecial xlPasteValues
Cells(1).Select
Application.CutCopyMode = False

Set wb = ActiveWorkbook
With wb
.SaveAs "C:\The DK Global Group\Excel\OrixBilling\Occ\OCC Fills" _
& " " & strdate & ".xls"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add wb.FullName
.Send 'or use .Display
End With
.ChangeFileAccess xlReadOnly
Kill .FullName ' delete the file you send
.Close False
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing
End Sub



--
Regards Ron de Bruin
http://www.rondebruin.nl


"sungen99" wrote in message ...

Thanks so much Ron for your help. Please understand however that as far
as programing goes I'm just a hack now. Just good at copying and
slightly modifiing code.


Bellow is the part of my code that saves the file. I honestly do not
know how to modifiy using your additional. Thanks so much again for
your contuned help.


Sh.Copy
ActiveSheet.Copy

Cells.Copy
Cells.PasteSpecial xlPasteValues
Cells(1).Select
Application.CutCopyMode = False



------------------------------------------------------


Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem

strdate = Format(Now, "mm-dd-yy")



Application.DisplayAlerts = False



Dim wb As Workbook
Sheets(Array("OCC")).Copy
Set wb = ActiveWorkbook
wb.SaveAs Filename:="C:\The DK Global Group\Excel\Orix
Billing\Occ\OCC Fills " & Format(Date, "mm-dd-yy") & ".xls"
wb.Close False

Application.DisplayAlerts = True


--
sungen99
------------------------------------------------------------------------
sungen99's Profile: http://www.excelforum.com/member.php...fo&userid=9144
View this thread: http://www.excelforum.com/showthread...hreadid=269010