Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro free workbook saves macro
im using office 2007, i record a macro of the current workbook (create a copy
of a the worksheet, and save it as a macro free workbook.) the macro is assigned to a picture on the same worksheet. when i open the newly created workbook of the worksheet, and click the picture, the macro is available and it runs. when i look in the code modules for the new workbook, the macro is not listed anywhere. the code from when i create a copy of the one sheet is as follows: 'copy sheet, and save as new workbook Sheets("Purchase Order (Inventory)").Select Sheets("Purchase Order (Inventory)").Copy ActiveWorkbook.SaveAs Filename:=Range("H7").Value & Range("H6").Value & "\" & _ Format(Now, "yyyy-mm-dd, ") & "PO# " & Range("M5").Value & ", Claim (" & Range("H6").Value & ").xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False ActiveSheet.Unprotect Password:="*******" ' remove sourced information, and replace it with actual values Range("H5:K7").Select Selection.Copy Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Range("H8:K9").Select Application.CutCopyMode = False Selection.ClearContents Range("H5:K5").Select Selection.Locked = True Selection.FormulaHidden = False ActiveWorkbook.Save ActiveSheet.Protect Password:="*******", DrawingObjects:=True, Contents:=True, Scenarios:=True ActiveWorkbook.Save ActiveWindow.Close at this point i am returned back to my original file. is there anything that i am missing? jat |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007Warning, "The following fetures cannot be saved in a macro-free workbook: | Excel Programming | |||
Cyclic Data Macro Q | Free Copy Macro | Excel Programming | |||
Macro Free Workbook? | Excel Programming | |||
Macro that saves excel workbook as PDF?? | Excel Discussion (Misc queries) | |||
disableing a macro after it saves workbook | Excel Programming |