ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Security and working with VBComponents (https://www.excelbanter.com/excel-programming/374811-security-working-vbcomponents.html)

Keithlo

Security and working with VBComponents
 
My macro fails at this code:

With WB.VBProject.VBComponents(2).CodeModule
..DeleteLines 1, .CountOfLines
End With

In my macro security, I do not have the "Trust access to visual basic
project" checkbox checked. But even if that is the right thing to do, can
anyone tell me what this line of code is doing? Is it deleting the VB code
from the workbook "WB"?

Thanks,

Keith

Ron de Bruin

Security and working with VBComponents
 
Hi Keithlo

See
http://www.cpearson.com/excel/vbe.htm

And also
http://www.j-walk.com/ss/excel/tips/tip96.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Keithlo" wrote in message ...
My macro fails at this code:

With WB.VBProject.VBComponents(2).CodeModule
.DeleteLines 1, .CountOfLines
End With

In my macro security, I do not have the "Trust access to visual basic
project" checkbox checked. But even if that is the right thing to do, can
anyone tell me what this line of code is doing? Is it deleting the VB code
from the workbook "WB"?

Thanks,

Keith




Keithlo

Security and working with VBComponents
 
Thank you so much, sir. I will try these.

Keithlo

"Ron de Bruin" wrote:

Hi Keithlo

See
http://www.cpearson.com/excel/vbe.htm

And also
http://www.j-walk.com/ss/excel/tips/tip96.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Keithlo" wrote in message ...
My macro fails at this code:

With WB.VBProject.VBComponents(2).CodeModule
.DeleteLines 1, .CountOfLines
End With

In my macro security, I do not have the "Trust access to visual basic
project" checkbox checked. But even if that is the right thing to do, can
anyone tell me what this line of code is doing? Is it deleting the VB code
from the workbook "WB"?

Thanks,

Keith






All times are GMT +1. The time now is 12:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com