ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Saving a worksheet with links (https://www.excelbanter.com/excel-programming/313472-saving-worksheet-links.html)

sungen99[_16_]

Saving a worksheet with links
 

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


Bellow is the part of my code that saves the file. I honestly do no
know how to modifiy using your additional. Thanks so much again fo
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\Ori
Billing\Occ\OCC Fills " & Format(Date, "mm-dd-yy") & ".xls"
wb.Close False

Application.DisplayAlerts = Tru

--
sungen9
-----------------------------------------------------------------------
sungen99's Profile: http://www.excelforum.com/member.php...nfo&userid=914
View this thread: http://www.excelforum.com/showthread.php?threadid=26901


Ron de Bruin

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





All times are GMT +1. The time now is 11:07 PM.

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