各位大侠,请指点小弟一下 怎么使用VB.NET来调用一个已在excel文件中的宏(急)
各位大侠,请指点小弟一下 怎么使用VB.NET来调用一个已在excel文件中的宏 --------------------编程问答-------------------- 谢谢 --------------------编程问答-------------------- up --------------------编程问答-------------------- 修改注册表:Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security]
"Level"=dword:00000001
"DontTrustInstalledFiles"=dword:00000000
"AccessVBOM"=dword:00000001
vb.net
Dim Exc As Excel.Application
Dim XxcBook As Excel.Workbook
EXC = New Microsoft.Office.Interop.Excel.Application
EXC.Visible = True
EXC.Workbooks.Add
Dim Vba As Microsoft.Vbe.Interop.VBComponent = Nothing
For xh As Int16 = 1 To oXL.VBE.ActiveVBProject.VBComponents.Count
If oXL.VBE.ActiveVBProject.VBComponents.Item(xh).Name = "工程名称" Then
Vba = oXL.VBE.ActiveVBProject.VBComponents.Item(xh)
End If
Next
For xh As Int16 = 1 To oXL.VBE.ActiveVBProject.VBComponents.Count
If EXC.VBE.ActiveVBProject.VBComponents.Item(xh).Name = "过程名称" Then
Vba = EXC.VBE.ActiveVBProject.VBComponents.Item(xh)
End If
Next
EXC.Run("过程名称",参数列表)
补充:.NET技术 , VB.NET