View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
SB SB is offline
external usenet poster
 
Posts: 4
Default Using VBA to Write VBA code

Chip / Anyone

The problem at the beginning of this thread was a "subscript out of
range error" on the following line of code:

With ActiveWorkbook.VBProject. _
VBComponents(shtNewNotesSheet.Name).CodeModule

Chip suggested changing .name to .codename which seemed to work for a
short while. On testing I got other error messages which was to do
with the VBproject being protected, and hence no code could be added
to it. I have now resolved that problem using some SendKeys code
obtained from the newsgroup. HOWEVER I am now getting the same error
noted above whether I use .name or .codename.

Can anyone help me please?