sht and wrkbook proc copy

X

x tomi3440

Dim comS As VBIDE.VBComponent, comD As VBIDE.VBComponent, wbS, wbD, codM
As CodeModule, srshtS, srshtD
Dim comsS As VBIDE.VBComponents, comsD As VBIDE.VBComponents
Set comsS = ThisWorkbook.VBProject.VBComponents
Set comsD = Workbooks("ha.xls").VBProject.VBComponents

For Each comS In comsS
If comS.Type = vbext_ct_Document Then
Set codM = comS.CodeModule
srcodS = codM.Lines(1, codM.CountOfLines)
For Each comD In comsD
If comD.Type = vbext_ct_Document Then
srshtS = comS.Properties("name")
srshtD = comD.Properties("name")
If srshtS = srshtD Or codM = "ThisWorkbook" Then
comD.CodeModule.AddFromString srcodS 'error line
Exit For 'error line
End If
End If
Next
End If
Next

I want to copy sheets and thisworkbook procedures between
projects.......
but,,, error ..... ooooooooooh
error occur, and the excel application is killed







*** Sent via Developersdex http://www.developersdex.com ***
 
X

x tomi3440

hey, barb!
I know the site already......
I did many method for acomplishment the object...
But, I failed....
the stadard module, class module, form module is succed.. but the sht,
and thisworkbook module.... is difficult...

I want to get help from anyone.



*** Sent via Developersdex http://www.developersdex.com ***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top