SherryO
03-07-2006, 07:47 AM
I'm trying to delete lines of code that I have in Workbook_open before a save. The workbook in question is a template and before it's saved as an xls file I want to delete the open code because it's only necessary once. I'm getting the following errors when I try to execute:
Runtime Error 1004: Programmatic access to Visual Basic Project is not trusted.
and then
Runtime Error 1004: Method 'VBProject' of object '_workbook' failed.
Here is the line of code:
ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule.DeleteLines 25, 1
I would like to delete more than just one line, but I'm stuck here. Any help would be greatly appreciated.
Thanks!!
Runtime Error 1004: Programmatic access to Visual Basic Project is not trusted.
and then
Runtime Error 1004: Method 'VBProject' of object '_workbook' failed.
Here is the line of code:
ThisWorkbook.VBProject.VBComponents("ThisWorkbook").CodeModule.DeleteLines 25, 1
I would like to delete more than just one line, but I'm stuck here. Any help would be greatly appreciated.
Thanks!!