
API
northwolves
MS-VB-MVP
MS-EXCEL-MVP
展开
-
关于 SENDKEYS 的代码
sendkeys 的用法(MSDN): SendKeys 语句 将一个或多个按键消息发送到活动窗口,就如同在键盘上进行输入一样。语法SendKeys string[, wait]SendKeys 语句的语法具有原创 2005-09-26 07:03:00 · 4099 阅读 · 0 评论 -
Export selection of word document as an image file
原文地址:http://www.spotlight-wissen.de/archiv/message/1665077.htmlOption Explicit (c) Désirée und Wolfram, 3/2005 Modifiziert: 11/2007 - Bilder mit runden Ecken versehen Bilder aus Winword im转载 2008-10-25 15:43:00 · 1929 阅读 · 0 评论 -
Export selection of word document as an image file(2)
Option ExplicitPrivate Declare Function EmptyClipboard Lib "user32" () As LongPrivate Declare Function OpenClipboard Lib "user32" _ (ByVal hwnd As Long) As LongPrivate Declare Fun翻译 2008-10-25 15:53:00 · 1755 阅读 · 0 评论 -
Can the msgbox vbYesNo button captions be changed in VBA?
Private sButton1 As StringPrivate sButton2 As StringPrivate sCaption As StringPrivate sText As StringPrivate Const MB_ICONQUESTION As Long = &H20&Private Const MB_OKCANCEL As Long = &H1&Private Const转载 2007-12-06 00:31:00 · 3234 阅读 · 0 评论 -
Save an userform as an image in EXCEL
When click a commandbutton in an Excel userform,save the entire userform as an image file in harddisk.Method 1Private Declare Sub Keybd_Event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte,原创 2007-10-04 18:17:00 · 4182 阅读 · 0 评论 -
应用API函数在用户窗体中画圆
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String)原创 2007-09-23 14:23:00 · 3301 阅读 · 0 评论 -
用VBA来解决大数据量计算逆矩阵的问题
EXCEL2003中应用minverse求逆矩阵,该函数在excel中的确存在计算范围上的限制,可能最大的计算范围是52*52。下面给出一个VBA的解法Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Lo原创 2007-09-21 13:54:00 · 5237 阅读 · 1 评论 -
在VBA中获取“我的文档”的目录路径
方法1. 读取注册表:Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long)原创 2007-09-23 14:31:00 · 3318 阅读 · 0 评论 -
全硬盘高速查找指定文件
Private Declare Function SearchTreeForFile Lib "ImageHlp.dll" (ByVal lpRoot As String, ByVal lpInPath As String, ByVal lpOutPath As String) As LongPrivate Declare Function GetDriveType Lib "kernel32"原创 2007-04-10 11:03:00 · 3739 阅读 · 0 评论 -
InputBox with Password Characters(转帖)
The following codes are from http://www.freevbcode.com/ShowCode.asp?ID=1214Add a form with commandbutton:Private Sub Command1_Click() Dim ret As String SetTimer hwnd, NV_INPUTBOX, 10, AddressO转载 2006-08-29 09:12:00 · 1285 阅读 · 0 评论 -
设置文本框的九种对齐方式(左上,中上,右上,左中,中中,右中,左下,中下,右下)
Add a commandbutton and a textbox( multiline=true) and copy the following codes to form1:Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Lo原创 2006-06-05 12:00:00 · 5114 阅读 · 0 评论 -
计算数组的维数
Option ExplicitPrivate Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, source As Any, ByVal Length As Long)Private Const VT_BYREF = &H4000&Private Sub Command1_Cli原创 2006-04-24 09:42:00 · 1890 阅读 · 0 评论 -
API判断数组是否为空
Private Declare Function SafeArrayGetDim Lib "oleaut32.dll" (ByRef saArray() As Any) As Long API判断数组为空或没有初始化 Sub diag()Dim msg As StringDim arr1() As String, arr2() As String, arr3() As Date,原创 2006-04-24 09:29:00 · 8358 阅读 · 0 评论 -
我想死你了
在窗体上镂空文字: 我想死你了Private Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long) As LongPrivate Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As LongPrivate Declare Function PathToRegion原创 2005-11-12 00:48:00 · 2309 阅读 · 0 评论 -
如何在LISTBOX中移动鼠标就可以起到CLICK的作用
曾经看到有些软件能够实现这个效果,无非是向LISTBOX发送消息,获得光标所在位置的ITEM;或者干脆模拟一个鼠标左键的单击事件。下面用两种方法分别一试:方法1 Sendmessage 向LISTBOX发送消息Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, By原创 2005-11-17 23:07:00 · 2499 阅读 · 0 评论 -
VBA 实现 POWERPOINT 的TIMER 事件
POWERPOINT 无TIMER 控件,也不支持 TIMER 事件。但如果想在播放POWERPOINT 时显示一个动态的时间,有没有可行的办法?笔者曾为此十分苦恼,四处求救,始终没有满意的答复(多数建议添加FLASH 格式的CLOCK),近日想起了延时函数SLEEP,一试竟然成功,问题终于得以解决,特此与广大优快云朋友共享。代码如下Option ExplicitPrivate Declare原创 2005-10-09 22:02:00 · 10843 阅读 · 3 评论 -
VBA代码控制DTPicker控件的下拉日期表显示
DTPicker1控件的下拉按钮请问怎么写代码可以使得DTPicker控件的下拉日期表显示出来呢?!Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _(ByVal hWnd As Long, _ByVal wMsg As Long, _ByVal wParam As Long,原创 2009-11-05 21:25:00 · 6929 阅读 · 0 评论