摘要:
一般情况:cnn = "OLEDB;Provider=IBMDA400;Data Source=TFB4001;User ID=;Password=;"Sql = "select * from NON"Set sh = ThisWorkbook.Worksheets("sheet1")sh.Quer... 阅读全文
摘要:
Public Function PadLeft(ByVal s As String, ByVal i As Integer, ByVal c As String) If i > LenB(s) Then PadLeft = String(i - LenB(StrConv(s, vbFromUnico... 阅读全文
摘要:
在DOS时代,拥有一个华丽的汉字菜单几乎是每个高档中文应用程序必须的包装。中文Windows操作系统的出现使得高级开发平台实现全中文的提示和界面非常容易和方便。在一般的应用程序中已经很少需要去专门考虑汉字处理的问题。 但是在许多工程控制和字符串处理的环境中,汉字字符的处理仍然有别于西文字符的处... 阅读全文
摘要:
textbox的值为空或没有更改时,按下回车键textbox会失去焦点此时用textbox1.setfocus不能使textbox1重新获取焦点Private Sub Textbox1_KeyDown(KeyCode As Integer, Shift As Integer)If KeyCode =... 阅读全文
摘要:
VB在内存释放方面是这样的,首先和其他任何语言一样,如果是在stack分配的空间的话,操作系统自动进行管理比如下面的语句dimaasstring'当a超出它的作用范围以后,就会被释放掉它所占用的空间。其次,如果是在heap中分配空间的话,比如用如下语句seta=newrealOjbect1这样什么时... 阅读全文
摘要:
VBA.FileCopy 阅读全文
摘要:
' 创建配置文件 Open ThisWorkbook.Path & "\schema.ini" For Append As #1 Print #1, "[table2.csv] " Print #1, "Format=CSVDelimited " Print #1, "ColNameHead... 阅读全文
摘要:
Private strFiles(20)Private Sub GetFiles(ByVal strFolder As String, ByVal ty As String) ' 获取文件列表 If iFiles = 0 Then Erase strFiles End If If iFiles >... 阅读全文
摘要:
Private Function SelectFolder() As String With Application.FileDialog(msoFileDialogFolderPicker) If .Show = True Then SelectFolder = .SelectedItems... 阅读全文
摘要:
定制模块行为(1) Option Explicit '强制对模块内所有变量进行声明 Option Private Module '标记模块为私有,仅对同一工程中其它模块有用,在宏对话框中不显示 Option Compare Text '字符串不区分大小写 Option Base 1 '指定数组... 阅读全文