![]() |
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? |
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? |
All times are GMT +1. The time now is 03:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com