I have an Excel97 file for which there is a function to create a summary file to send to Head Office.
At present this file replaces all formulas with values, and contains no code.
It has been requested that the print function is carried across to the copy file. However, the VBA project
in the main file is password protected to stop people playing, and this is stopping me from copying
the required code to the copy file.
Is there a way, via code, that I can export a module from a PASSWORD PROTECTED module? Or a way to unprotect
and then re-protect the project?
The code I was trying to use was:
Workbooks(ThisFile).VBProject.VBComponents("PrintUK".Export "C:\Code.bas"
Workbooks(SaveUKFile).VBProject.VBComponents.Import("C:\Code.bas".Name = "PrintUK"
Kill ("C:\Code.bas"
Thanks In Advance.
At present this file replaces all formulas with values, and contains no code.
It has been requested that the print function is carried across to the copy file. However, the VBA project
in the main file is password protected to stop people playing, and this is stopping me from copying
the required code to the copy file.
Is there a way, via code, that I can export a module from a PASSWORD PROTECTED module? Or a way to unprotect
and then re-protect the project?
The code I was trying to use was:
Workbooks(ThisFile).VBProject.VBComponents("PrintUK".Export "C:\Code.bas"
Workbooks(SaveUKFile).VBProject.VBComponents.Import("C:\Code.bas".Name = "PrintUK"
Kill ("C:\Code.bas"
Thanks In Advance.