Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy & Paste from One Workbook to a Macroed Template Workbook
Hello.
What I want to do is Open a Macroed Template Workbook (via Macro) from another workbook. The Template Workbook has ActiveSheet Protection & other macros which need to be disabled prior to copying & pasting from My Workbook. At the moment what I have been doing is Enabling the Macros on Open, then running an ActiveSheet Unprotect macro, closing the file, then re-opening it with Macros disabled, then copying & pasting a range from My Workbook. I then use Save As and rename the New (Template) File. My aim is to develop the files (& their automation), then pass both onto another user, so ideally I want to bypass the Enable, Disable Close Re-open portion before I do this. Any ideas? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy & Paste from One Workbook to a Macroed Template Workbook
I think you have already done it!
I take it you have been recording macros rather than editing directly in the VBA editor! Keeping it simple if you go to your macro then click "step into" you can see the recorded code. you could then copy and paste the active sheet unprotect macro, workbook open macro and save rename macro all into one macro. the code to open a workbook would be: Sub OpenUp() Workbooks.Open("C:\MyFolder\MyBook.xls") ActiveWorkbook.Unprotect End Sub "VickiMc" wrote: Hello. What I want to do is Open a Macroed Template Workbook (via Macro) from another workbook. The Template Workbook has ActiveSheet Protection & other macros which need to be disabled prior to copying & pasting from My Workbook. At the moment what I have been doing is Enabling the Macros on Open, then running an ActiveSheet Unprotect macro, closing the file, then re-opening it with Macros disabled, then copying & pasting a range from My Workbook. I then use Save As and rename the New (Template) File. My aim is to develop the files (& their automation), then pass both onto another user, so ideally I want to bypass the Enable, Disable Close Re-open portion before I do this. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy/Paste Template to New Workbook | Excel Programming | |||
copy and paste using code from workbook to workbook | Excel Discussion (Misc queries) | |||
Selecting data from 1 workbook to copy and paste to a 2nd workbook | Excel Programming | |||
Need a macro to copy a range in one workbook and paste into another workbook | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming |