|
楼主 |
发表于 2011-5-26 16:13
|
显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
回复 82楼 zhj1978 的帖子
VBS源码已经公布了,你自己不会转VB吗?
- Const Vs As String = "版本信息: V2.20 - 2011.05.25" & vbCr & vbCr & "版权所有: 2010-2011 玲珑科技"
- Const BT As String = "通用扩展EXCEL工具集"
- Const FileName As String = "EXKZ.DLL"
- Public FilePath
- Private Sub Command1_Click() '安装按钮
- On Error Resume Next
- For Each Process In GetObject("winmgmts:").ExecQuery("select * from Win32_Process where name='excel.exe'")
- Process.Terminate (0)
- Next
- Shell "regsvr32 /s " & FilePath & "" & FileName
- Set oXL = CreateObject("Excel.Application")
- oXL.Workbooks.Add
- Set oAddin = oXL.AddIns.Add("EXKZ.ButtonEvent", True)
- oAddin.Installed = True
- oXL.Quit
- Set oXL = Nothing
- Unload Me
- End Sub
- Private Sub Command2_Click() '卸载按钮
- On Error Resume Next
- For Each Process In GetObject("winmgmts:").ExecQuery("select * from Win32_Process where name='excel.exe'")
- Process.Terminate (0)
- Next
- Shell "regsvr32 /s /u " & FilePath & "" & FileName
- Kill FilePath & "" & FileName
- Unload Me
- End Sub
- Private Sub Command3_Click() '退出按钮
- Unload Me
- End Sub
- Private Sub Form_Load() '窗体载入
- On Error Resume Next
- Call SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3)
- Me.Top = (Screen.Height - Me.Height) / 2
- Me.Left = (Screen.Width - Me.Width) / 2
- '------------------初始化安装窗口信息
- Me.Caption = "安装 " & BT
- lblTitle.Caption = vbCr & BT
- lblDescription.Caption = Vs
- FilePath = Split(Environ("Path"), ";")(0)
- End Sub
复制代码 就一个窗体配3个按钮,我自己的安装程序都是这个样子,如:
http://club.excelhome.net/redire ... 1468&ptid=28166 |
评分
-
1
查看全部评分
-
|