开发工具:
文件大小: 2kb
下载次数: 0
上传时间: 2013-12-15
详细说明:
首先:Imports System.Runtime.InteropServices 然后: Private Declare Function EbExecuteLine Lib "VBA6.DLL" (ByVal pStringToExec As Long, ByVal Unknownn1 As Long, ByVal Unknownn2 As Long, ByVal fCheckOnly As Long) As Long ' Public Shared Function EbExecuteLine(ByVal pStringToExec As Long, ByVal Unknownn1 As Long, ByVal Unknownn2 A s Long, ByVal fCheckOnly As Long) As Long ' Public Shared Function EbExecuteLine(ByVal pStringToExec As Long, ByVal Unknownn1 As Long, ByVal Unknownn2 As Long, ByVal fCheckOnly As Long) As Long 'End Function ' 'Public Shared Function EbExecuteLine(ByVal pStringToExec As Long, ByVal Unknownn1 As Long, ByVal Unknownn2 As Long, ByVal fCheckOnly As Long) As Long 'End Function '定义StrPtr函数,实现获取字符串地址功能 Private Function StrPtr(ByVal e As Object) As Int32 Dim GC As System.Runtime.InteropServices.GCHandle = System.Runtime.InteropServices.GCHandle.Alloc(e, System.Runtime.InteropServices.GCHandleType.Pinned) Dim GC2 As Int32 = GC.AddrOfPinnedObject.ToInt32 GC.Free() Return GC2 End Function Function ExecuteLine(ByVal sCode As String, Optional ByVal fCheckOnly As Boolean = True) As Boolean ExecuteLine = EbExecuteLine(StrPtr(sCode), 0, 0, 0) End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim dm() As String Dim i As Long dm = Split(TextBox.Text, ";") For i = 0 To UBound(dm) If Len(dm(i)) <> 0 Then Dim Result As Boolean Result = ExecuteLine(dm(i)) If Result = False Then Debug.Print(i + 1 & vbTab & "行执行错误") Else Debug.Print(i + 1 & vbTab & "行代码错误") End If Next End Sub ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.