Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following code to create a new workbook and send via outlook
to whatever adress the user enters. Private Sub Send1_Click() Dim strdate As String Sheets(Array("Emp24", "Main")).Copy strdate = Format(Date, "dd-mm-yy") & " " & Format(Time, "h-mm-ss") Worksheets("Emp24").Name = "NewData" ActiveWorkbook.SaveAs "NewEmployeeData.xls" ActiveWorkbook.SendMail "", _ "Employee Attendance Data" ActiveWorkbook.ChangeFileAccess xlReadOnly Kill ActiveWorkbook.FullName ActiveWorkbook.Close False End Sub In the original workbook inside the This Workbook section I have the following: Private Sub Workbook_Open Dim lngColor As Long lngColor = RGB(221, 221, 221) ActiveWorkbook.Colors(16) = lngColor End Sub How can I place this 2nd code into the This Workbook section of the file being sent i the first sub? Thank You for any help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy and paste using code from workbook to workbook | Excel Discussion (Misc queries) | |||
Close a the current workbook and load another specified workbook | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming | |||
Place code in a new workbook with a macro. | Excel Programming | |||
Transparently updating another workbook from the current workbook | Excel Programming |