View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trefor Trefor is offline
external usenet poster
 
Posts: 201
Default Proplem copying a Module - Error 50289


I found the following code (sorry can't remember where now), it work great
with one catch, if ThisWorkbook is password protected the routine fails.

Dim myFile As String
myFile = "CCRFMacro.bas"
ThisWorkbook.VBProject.VBComponents("CCRFMacro").E xport (myFile)
ActiveWorkbook.VBProject.VBComponents.Import (myFile)
Kill myFile

The error is "Can't perform operation since the project is projected."

I do not want to unprotect the project, so is there another option to copy a
mudule from ThisWorkbook to ActiveWorkbook?

--
Trefor