View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
utdcr utdcr is offline
external usenet poster
 
Posts: 2
Default How to write a macro to import an event procedure to ThisWorbook?

Hello,

I have an event procedure (Workbook_BeforeSave) which I tried to write a
macro to import into ThisWorkbook. The reason for doing this is that I try to
format this procedure into 1200 Excel files and it is impossible I do it
manually.

I tried to use the following code to accomplish this. But it didn't work.

With ThisWorkbooks.VBProject.VBComponents
.Import impfile
End With

It was imported but didn't go to ThisWorkbook. It added a new module instead.

Anyone can help me to resolve this problem? This is my 1st post in this forum.

Thanks a lot!

utdcr,