求VBIDE示例代码.
目标定位详见http://club.excelhome.net/thread-560782-1-1.html
问题提出.下面这段程序在EXCEL-VBA中调试通过.
Private Sub Form_Load()
Dim FileName As String, oPath
Dim oVbe As VBComponent
FileName = "aa.xls"
Dim Wb As Workbook, Xls As Excel.Application
Set Xls = GetObject(, "Excel.Application")
Set Wb = Xls.Workbooks(FileName)
'模拟Excel程序通过.
For Each oVbe In Wb.VBProject.VBComponents
With oVbe
Debug.Print .Name, .Type
Select Case .Type
Case 1
在VB中问题出在这里,excel的Thisworkbook,在VB中用什么代替??
???? ------.VBProjects.Add(vbext_pt_StandAlone).Name = .Name End Select End With
Next oVbe
End Sub
[解决办法]
Thisworkbook有时对应的是Application.ActiveWorkbook
[解决办法]
百度了一下,这段小文章似乎已经将做VBIDE插件的基础介绍到了
http://www.yesky.com/198/1733698.shtml
使用插件功能扩展VB