View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 380
Default Rename Module via VBA

Excel 2002 added a new security setting was added whereby you must grant
access in order to manipulate objects that are part of the VBProject with
VBA.


From the menu Tools/Macro/Security, select the Trusted Sources tab and check
"Trust Access to Visual Basic Project".


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"Gary''s Student" wrote in message
...
While running:

Sub rename_it()
ThisWorkbook.VBProject.VBComponents("Module1").Nam e = "new_check"
End Sub

I get a "1004" error

"Programmatic access to Visual Basic Project is not trusted"

I feel that i have earned the trust of my computer and my own files.

How do I avoid this error.

p.s. I can still re-name a module manually in the editor.

--
Gary's Student