help in updating macro to office excel 2007 - macro enabled workbo
good morning,
i compiled this macro for office 2003 with help from users here, and now i'm
back again because we have upgraded to office 2007. i have also changed the
file to office 2007 - macro enabled.
the following macro, sends a copy of the excel sheet, then saves a copy in
pdf format (using the MS add-in) and goes through a few other things as you
will see. i need two things in this macro, and i have those items [IN THIS
FORMAT - ALL CAPS]
Sub POInv()
' Macro recorded 8/28/2006 by Jat
'
If ActiveSheet.Name = "Purchase Order (Inventory)" Then
'Sub SaveName() - multiple steps
ActiveSheet.Copy 'creates a new one page workbook with a copy of
the activesheet in it, this becomes the activesheet/book
ActiveSheet.Name = Range("L5").Value 'renames the active sheet
(from ActiveSheet.Copy) to the purchase order value located in cell M5 [I
WOULD LIKE THE SHEET NAME TO INCLUDE THE SUPPLIER NAME IN CELL D11. I have
tried adding the cell d11 into the activesheet.name range but i cannot figure
it out.]
Range("L7") = Now
strdate = Format(Now, "mm-dd-yy h-mm-ss")
ActiveSheet.Protect
'End Sub
'Sub Email() - sends a copy of the email to the recipients in an excel
format(should be accounts payable department, or similar)
ActiveWorkbook.SendMail Recipients:="ap@myemailaccount.ca",
Subject:=ActiveSheet.Name
[IN THE EMAIL, THE EXCEL ATTACHMENT'S NAME IS BOOK1.XLSX. I WOULD LIKE THE
ATTACHMENT'S NAME TO BE THE SAME AS THE ACTIVESHEET.NAME. I tried
Attachment:=ActiveSheet.Name but not that easy.]