Hello,
How can I insert code in ThisWorkbook module in Workbook_Open event? I would like something like code in code so I can write in my macro line by line what should be putted in Workbook_Open in ActiveWorkbook.
Hello,
How can I insert code in ThisWorkbook module in Workbook_Open event? I would like something like code in code so I can write in my macro line by line what should be putted in Workbook_Open in ActiveWorkbook.
Good evening owiec
Try using this code :
Before you run it set a reference within the VBE to Microsoft Forms 2.0.Please Login or Register to view this content.
Go to Tools > References, find and tck "Microsoft Forms 2.0 Object Library" and click OK.
HTH
DominicB
Please familiarise yourself with the rules before posting. You can find them here.
Hi,
Thanks for reply.
I get error Subscript out of range and it points toWhen I put something like MsgBox ActiveWorkbook.CodeName its returne blank window. Should it be like that?Set wbcodemod = ActiveWorkbook.VBProject.VBComponents(ActiveWorkbook.CodeName).CodeModule
I know that ActiveWorkbook is working cuz when I put MsgBox ActiveWorkbook.Name it returns aproperiate value.
Last edited by owiec; 03-12-2010 at 03:53 AM.
Hi owiec
Your profile states you are running XL2003. Is this still the case?
I tested the code last night on an XL2003 and it worked fine. I've tested it again this morning on a different machine and it still works fine.
Try running the macro in the attached file and let me know how it goes.
HTH
DominicB
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks