vijayendra.shukla
New Member
- Joined
- Jan 29, 2010
- Messages
- 34
Hi,
I am trying to generate a dynamic user-form via vb code. I have protected the code module using VBA Project Properties. But when I re-open the workbook and run the code, I am getting the
"Runtime error - '50289' - Application defined or Object defined error.".
When I tried putting some msgbox after particular lines, i got to know that error is coming while executing the below given line:
Here TempForm is defined as Object using Dim statement.
I am not sure why it is showing this error for this particular line.
But When code is not protected, it runs fine without any error. Is there any way that I can protect my code without getting into this error.
Thanks for your help and time.
I am trying to generate a dynamic user-form via vb code. I have protected the code module using VBA Project Properties. But when I re-open the workbook and run the code, I am getting the
"Runtime error - '50289' - Application defined or Object defined error.".
When I tried putting some msgbox after particular lines, i got to know that error is coming while executing the below given line:
Code:
Set TempForm = ThisWorkbook.VBProject.VBComponents.Add(3)
I am not sure why it is showing this error for this particular line.
But When code is not protected, it runs fine without any error. Is there any way that I can protect my code without getting into this error.
Thanks for your help and time.