怎么样在vb 中以VBMODAL的方式来显示EXCEL或WORD对象。这样可以控制好EXCEL或WORD对象的释放。
解决方案 »
- ctgrid不能输入中文的问题
- 在另一台电脑上运行VB程序,系统提示找不到图片或其他文件?
- 求人做项目,付费!
- 兼容性问题 在98/2000下使用正常,有些XP下提示 系统错误,找不到模块 在线等,急!
- 如何让用户选择目录?
- ███ VB 排版系统的源代码 ███
- DriveListBox怎么设置能选择局域网中的内容?急急急急急急急!!!!!!!
- 如何用mscomm控件来接收发过来的数据,让显示在文本控中
- 在VB中如何连接远程ORACLE数据库(没有安装ORACLE客户端),小弟菜鸟,请大侠帮忙!
- 关于98、NT问题
- !!! 急 急 急 在使用datagrid控件 用insert into 语句的问题
- 斑竹请帮忙:关于timer的延迟问题
Public Function ShowProcess(FileName As String, ByVal OwnerhWnd As Long, Optional ByVal strCmd As String = "open") As Long
Dim SEI As SHELLEXECUTEINFO
Dim r As Long
With SEI
'Set the structure's size
.cbSize = Len(SEI)
'Set the mask
.fMask = SEE_MASK_FLAG_DDEWAIT Or SEE_MASK_NOCLOSEPROCESS
'Set the owner window
.hwnd = OwnerhWnd
'Show the properties
.lpVerb = strCmd '"open" '"properties"
'Set the filename
.lpFile = FileName
.lpParameters = vbNullChar
.lpDirectory = vbNullChar
.nShow = SW_SHOWMAXIMIZED
.hInstApp = 0
.lpIDList = 0
End With
r = ShellExecuteEx(SEI)
If r Then
ShowProcess = SEI.hProcess
End If
End FunctionPublic Function WaitModifyTaskDocument(ByRef strTFn As String) As Boolean
On Error GoTo ErrDeal
Dim lngHProcess As Long, lngReturn As Long
Dim blnR As Boolean
lngHProcess = ShowProcess(strTFn, 0)
If lngHProcess <> 0 Then
lngReturn = WaitForSingleObject(lngHProcess, INFINITE)
If lngReturn <> csWAIT_OBJECT_0 Then
SetLastErrorEx "µÈ´ýÓû§ÔĶÁ" & csTASKNOTEMESSAGE & "´íÎó£¡"
GoTo ErrDeal
End If
blnR = CBool(TerminateProcess(lngHProcess, 0))
'John 2002-03-29
'in windows98 ev the terminateprocess function return true value
'but in winnt or window2000 ev the terminateprocess function return false value
'so set the blnr = true
blnR = True
End If
WaitModifyTaskDocument = blnR
ErrDeal:
Select Case Err.Number
Case 0
Case Else
SetLastErrorEx Err.Description
End Select
End Function