Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
jat jat is offline
external usenet poster
 
Posts: 33
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007Warning, "The following fetures cannot be saved in a macro-free workbook: BobR Excel Programming 8 May 20th 10 03:41 PM
Cyclic Data Macro Q | Free Copy Macro badmrfrosty8 Excel Programming 9 December 18th 08 04:26 PM
Macro Free Workbook? Dustin Excel Programming 1 October 3rd 07 09:24 PM
Macro that saves excel workbook as PDF?? mydogpeanut Excel Discussion (Misc queries) 1 May 25th 06 08:56 PM
disableing a macro after it saves workbook happo Excel Programming 1 August 17th 05 02:30 PM


All times are GMT +1. The time now is 06:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"