With wb
Dim UpdateName As String
For Each meModule In wb.VBProject.VBComponents
With meModule
If (.Type = vbext_ct_StdModule And .Name = "Module1") Then
UpdateName = meModule.Name
Application.VBE.ActiveVBProject.VBComponents.Remove Application.VBE.ActiveVBProject.VBComponents(.Name)
abook.VBProject.VBComponents(UpdateName).Export "C:\copypaste\" & UpdateName
wb.VBProject.VBComponents.Import "C:\copypaste\" & UpdateName
End If
End With
Next
End With
-----------------------------------------------------------
上面這個程式,是我用export和import來匯入匯出
但是有一個問題,在匯入"Module1"時,excel vba內的模組名稱會被命名為"Module11"
多了一個"1",其他的都沒有問題,這個是excel的bug嗎?
還請各位答覆,謝謝!!作者: GBKEE 時間: 2013-4-10 18:40