Some macros disappear when workbook is copied from DVR to HD on computer.

1r3o2n8
1r3o2n8 used Ask the Experts™
on
After developing a workbook on one computer, I copied it to a DVR- and then copied from that DVD to another HD but "some" of the macro pages are blank. Please tell me the secret.  One geek sugested using SAVE AS instead of copy and past or dragging.  I look forward to your answer.   rgds/ron
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
There are several reasons that you won't see a macro in a workbook:

1) It's simply not there.  If it was saved in the Personal Workbook (or another workbook) instead of the specific workbook, it won't be copied.
2) It could be password-protected, in which case it will still usually work, but you won't see it
3) Macros could be disabled, but then you wouldn't have any of them working
4) Some macros might be Digitally Signed while others are not (although you're probably know about this if you wrote all the macros.)  Depending on your security settings, some may be enabled while others are disabled.

there are probably other reasons, but that's all that comes to mind.

One solution is to export all required macros from VB to a folder of your choice and include them on the CD if you don't mind having people possibly look at them.
Either way, do this and make a copy of the workbook and delete all of its macros.  If any still run, they are not located in the workbook that you think.
Also, in VBA, if you only have one workbook open and your VBA project shows multiple workbooks, one is probably the Personal workbook and will have its own Modules section where you can look to see if there are any macros stored there.
Most Valuable Expert 2012
Top Expert 2012
Commented:
That's a good tip.  Here's one other thought.

ron - when you go back to your original workbook on the one computer and RE-OPEN the file, are the macro's there in THAT file?  Could you have possibly not saved the file after writing some of the code?

I know - sounds like "is your computer plugged in?" but I've got to ask...

Author

Commented:
Attached is my wkbk  with macro1, macro2 & macro3 associated with acct no. order, beneficiary order, and originator order respectively.  The macros are now working but they are invisible, hidden or PW protected.  Can you help make my macros reappear?  I was also geting this error at one time but it has now disappeared:  "can't exit design mode because of Control "lable3" can not be created".I have about 100 copies of the workbook saved to DVD as I was devleoping.  All have the same macros missing.  Does that happen with copy and paste?  How do I prevent this from recurring?  I can end this session and start another with more points if you like.  Can I refer to this question by ID # whren I do that?  What's the bvest way?
PSBWIRE-2011---051411-1443.xlsm
11/26 Forrester Webinar: Savings for Enterprise

How can your organization benefit from savings just by replacing your legacy backup solutions with Acronis' #CyberProtection? Join Forrester's Joe Branca and Ryan Davis from Acronis live as they explain how you can too.

Most Valuable Expert 2012
Top Expert 2012

Commented:
They appear to be there - 6 modules of code and there's code in each sheet.

Which macros are you missing?

Dave
Most Valuable Expert 2012
Top Expert 2012

Commented:
macro's 1-2-3 are there, too.

Let me ask a simple question.  When you are in the VBA Project Editor (ALT-F11) area, do you see the Project - VBA Project folder?

If you hit View tab then, Project Explorer, do the Excel Objects (where the sheets are listed) and Modules show up in that window?

Dave

Commented:
When I open it (Excel 2007) I'm told that there is a password (and I have to open it Read-Only.)
Other than that, Alt-F8 brings up Macros 1,2,3 and a collection of others.

I suspect that you're looking in the wrong place for the macros.
Try using Alt-F8 to list the macros, select one (e.g. macro1) and click on the Edit button to see where it takes you.  It should take you to the module called Module3Main and the Sub macro1.

Author

Commented:
Thanks very much for your concerted effort on my behalf.  I found the solution based on both your ideas.  Sometimes I can't see the forest because of the trees.  
Your assistance was very much appreciated and done on a timely basis.  You have both halped me out in the past and I hope will continue.  rgds/ron

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial